Skip to content

Commit

Permalink
chore: enable clippy::wrong_self_convention
Browse files Browse the repository at this point in the history
This patch enables `clippy::wrong_self_convention` and fixes the
one related issue.
  • Loading branch information
rockstar committed Mar 1, 2024
1 parent dda22e6 commit 251136a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::declare_interior_mutable_const, clippy::borrow_interior_mutable_const, clippy::module_inception, clippy::result_large_err, clippy::type_complexity, clippy::upper_case_acronyms, clippy::wrong_self_convention)]
#![allow(clippy::declare_interior_mutable_const, clippy::borrow_interior_mutable_const, clippy::module_inception, clippy::result_large_err, clippy::type_complexity, clippy::upper_case_acronyms)]
mod kvstore;
mod package_db;
mod prelude;
Expand Down
9 changes: 6 additions & 3 deletions src/vocab/specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn parse_version_wildcard(input: &str) -> Result<(Version, bool)> {
/// Has to take a string, not a Version, because == and != can take "wildcards", which
/// are not valid versions.
impl CompareOp {
pub fn to_ranges(&self, rhs: &str) -> Result<Vec<Range<Version>>> {
pub fn to_ranges(self, rhs: &str) -> Result<Vec<Range<Version>>> {
use CompareOp::*;
let (version, wildcard) = parse_version_wildcard(rhs)?;
Ok(if wildcard {
Expand Down Expand Up @@ -169,8 +169,11 @@ impl CompareOp {
}
} else {
// no wildcards here
if self != &Equal && self != &NotEqual && !version.0.local.is_empty() {
bail!("Operator {:?} cannot be used on a version with a +local suffix", self);
if self != Equal && self != NotEqual && !version.0.local.is_empty() {
bail!(
"Operator {:?} cannot be used on a version with a +local suffix",
self
);
}
match self {
// These two are simple
Expand Down

0 comments on commit 251136a

Please sign in to comment.