Skip to content

Commit

Permalink
fix: Clippy panic warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiesler committed Apr 26, 2024
1 parent 2fca98b commit 552aff2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/client/stripe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ impl Client {
}

/// Create a new account pointed at a specific URL. This is useful for testing.
///
/// # Panics
/// If the url can't be parsed
pub fn from_url<'a>(url: impl Into<&'a str>, secret_key: impl Into<String>) -> Self {
Client {
client: BaseClient::new(),
Expand Down Expand Up @@ -76,7 +79,7 @@ impl Client {
url: Option<String>,
) -> Self {
let app_info = AppInfo { name, version, url };
self.headers.user_agent = format!("{} {}", USER_AGENT, app_info.to_string());
self.headers.user_agent = format!("{} {}", USER_AGENT, app_info);
self.app_info = Some(app_info);
self
}
Expand Down Expand Up @@ -126,6 +129,9 @@ impl Client {
}

/// Make a `POST` http request with urlencoded body
///
/// # Panics
/// If the form is not serialized to an utf8 string.
pub fn post_form<T: DeserializeOwned + Send + 'static, F: Serialize>(
&self,
path: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/resources/webhook_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ pub enum EventType {

impl std::fmt::Display for EventType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&serde_json::to_string(self).unwrap())
f.write_str(&serde_json::to_string(self).expect("serializing EventType should not fail"))
}
}

Expand Down

0 comments on commit 552aff2

Please sign in to comment.