Skip to content

Commit

Permalink
fix: Ignore false-positive lints from Clippy 1.50 (#926)
Browse files Browse the repository at this point in the history
The `clippy::unnecessary_wraps` lint also warns when the call site cannot be
modified. Since this is the case for `serde(default)` callbacks, we need to
ignore the lint.

The `clippy::wrong_self_convention` lint is actually correct. However, since
this is a major refactoring, we will take this in a follow-up.
  • Loading branch information
jan-auer authored Feb 12, 2021
1 parent 7962639 commit 6dfccae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ fn default_projectconfig_cache_prefix() -> String {
"relayconfig".to_owned()
}

#[allow(clippy::unnecessary_wraps)]
fn default_max_rate_limit() -> Option<u32> {
Some(300) // 5 minutes
}
Expand Down
1 change: 1 addition & 0 deletions relay-general/src/pii/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl PartialEq for Pattern {
}
}

#[allow(clippy::unnecessary_wraps)]
fn replace_groups_default() -> Option<BTreeSet<u8>> {
let mut set = BTreeSet::new();
set.insert(0);
Expand Down
2 changes: 2 additions & 0 deletions relay-general/src/types/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ pub trait FromValue: Debug {
}

/// Implemented for all meta structures.
// TODO: This trait should be named `IntoValue`.
pub trait ToValue: Debug + Empty {
/// Boxes the meta structure back into a value.
#[allow(clippy::wrong_self_convention)]
fn to_value(self) -> Value
where
Self: Sized;
Expand Down

0 comments on commit 6dfccae

Please sign in to comment.