Skip to content

Commit a565ee9

Browse files
committed
tweak(style): fix all clippy warnings
1 parent a12d170 commit a565ee9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/cache.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ impl Cache {
7272
/// // Use other methods for configuration
7373
/// ```
7474
#[inline]
75+
#[allow(clippy::new_ret_no_self)]
7576
pub fn new<P: AsRef<path::Path>>(path: P) -> crate::CacheBuilder {
7677
crate::CacheBuilder::new(path)
7778
}

src/metadata.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl Metadata {
119119
#[inline]
120120
pub fn check_integrity_of(&self, data: &[u8]) -> bool {
121121
let other_integrity: Md5Bytes = md5::compute(data).into();
122-
&other_integrity == &self.integrity
122+
other_integrity == self.integrity
123123
}
124124
}
125125

@@ -135,8 +135,8 @@ impl MetaDb {
135135
pub fn get_metadata(&self, key: &[u8]) -> Result<Metadata> {
136136
let data = match self.db.get(key) {
137137
Ok(Some(data)) => data,
138-
Ok(None) => Err(ForcepError::NotFound)?,
139-
Err(e) => Err(ForcepError::MetaDb(e))?,
138+
Ok(None) => return Err(ForcepError::NotFound),
139+
Err(e) => return Err(ForcepError::MetaDb(e)),
140140
};
141141
Metadata::deserialize(&data)
142142
}

0 commit comments

Comments
 (0)