Skip to content

Commit

Permalink
fix(clippy): Minor code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxuser committed Oct 4, 2024
1 parent b324e87 commit 3453b08
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub enum Error {
/// Target HTTP url
url: String,
/// HTTP headers
headers: http::HeaderMap,
headers: Box<http::HeaderMap>,
/// HTTP message body
body: String,
/// [`serde_json`] error
Expand Down
2 changes: 1 addition & 1 deletion src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl JsonExDeserializeMiddleware for reqwest::Response {
let res = serde_json::from_slice::<T>(&full).map_err(|e| Error::JsonHttpResponseError {
status: http_status,
url: url.to_string(),
headers,
headers: Box::new(headers),
body: String::from_utf8_lossy(&full).to_string(),
inner: e,
});
Expand Down
2 changes: 1 addition & 1 deletion src/flows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl Flows {

/// Shorthand for Windows Live authorization flow
/// - Depending on the argument `implicit` the
/// methods `implicit grant` or `authorization code` are chosen
/// methods `implicit grant` or `authorization code` are chosen
///
/// # Examples
///
Expand Down
2 changes: 2 additions & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ pub enum AccessTokenPrefix {
None,
}

#[allow(clippy::to_string_trait_impl)]
impl ToString for AccessTokenPrefix {
fn to_string(&self) -> String {
let prefix = match self {
Expand Down Expand Up @@ -488,6 +489,7 @@ impl FromStr for DeviceType {
}
}

#[allow(clippy::to_string_trait_impl)]
impl ToString for DeviceType {
fn to_string(&self) -> String {
let str = match self {
Expand Down
1 change: 1 addition & 0 deletions src/request_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl From<Vec<u8>> for XboxWebSignatureBytes {
}
}

#[allow(clippy::to_string_trait_impl)]
impl ToString for XboxWebSignatureBytes {
fn to_string(&self) -> String {
let bytes: Vec<u8> = self.into();
Expand Down
2 changes: 2 additions & 0 deletions src/tokenstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl From<TokenStore> for XalAuthenticator {
}
}

#[allow(clippy::to_string_trait_impl)]
impl ToString for TokenStore {
fn to_string(&self) -> String {
serde_json::to_string(&self).expect("Failed to serialize TokenStore")
Expand Down Expand Up @@ -142,6 +143,7 @@ impl TokenStore {
.read(true)
.write(true)
.create(true)
.truncate(true)
.open(filepath)?;

file.rewind()?;
Expand Down

0 comments on commit 3453b08

Please sign in to comment.