[cache_dump] Squash some clippy warnings
This commit is contained in:
parent
3cf0dba469
commit
fdcc09c27e
4
src/cache/check.rs
vendored
4
src/cache/check.rs
vendored
@ -35,7 +35,7 @@ impl CheckMappingVisitor {
|
||||
|
||||
fn seen_oblock(&self, b: u64) -> bool {
|
||||
let seen_oblocks = self.seen_oblocks.lock().unwrap();
|
||||
return seen_oblocks.contains(&b);
|
||||
seen_oblocks.contains(&b)
|
||||
}
|
||||
|
||||
fn record_oblock(&self, b: u64) {
|
||||
@ -46,7 +46,7 @@ impl CheckMappingVisitor {
|
||||
// FIXME: is it possible to validate flags at an early phase?
|
||||
// e.g., move to ctor of Mapping?
|
||||
fn has_unknown_flags(&self, m: &Mapping) -> bool {
|
||||
return (m.flags & self.allowed_flags) != 0;
|
||||
(m.flags & self.allowed_flags) != 0
|
||||
}
|
||||
}
|
||||
|
||||
|
4
src/cache/dump.rs
vendored
4
src/cache/dump.rs
vendored
@ -23,7 +23,7 @@ struct MappingEmitter {
|
||||
impl MappingEmitter {
|
||||
pub fn new(emitter: Arc<Mutex<dyn MetadataVisitor>>) -> MappingEmitter {
|
||||
MappingEmitter {
|
||||
emitter: emitter,
|
||||
emitter,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ struct HintEmitter<Width> {
|
||||
impl<Width> HintEmitter<Width> {
|
||||
pub fn new(emitter: Arc<Mutex<dyn MetadataVisitor>>) -> HintEmitter<Width> {
|
||||
HintEmitter {
|
||||
emitter: emitter,
|
||||
emitter,
|
||||
_not_used: PhantomData,
|
||||
}
|
||||
}
|
||||
|
4
src/cache/mapping.rs
vendored
4
src/cache/mapping.rs
vendored
@ -22,11 +22,11 @@ pub struct Mapping {
|
||||
|
||||
impl Mapping {
|
||||
pub fn is_valid(&self) -> bool {
|
||||
return (self.flags & MappingFlags::Valid as u32) != 0;
|
||||
(self.flags & MappingFlags::Valid as u32) != 0
|
||||
}
|
||||
|
||||
pub fn is_dirty(&self) -> bool {
|
||||
return (self.flags & MappingFlags::Dirty as u32) != 0;
|
||||
(self.flags & MappingFlags::Dirty as u32) != 0
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ impl<V: Unpack> ArrayBlock<V> {
|
||||
}
|
||||
}
|
||||
|
||||
fn convert_result<'a, V>(r: IResult<&'a [u8], V>) -> Result<(&'a [u8], V)> {
|
||||
fn convert_result<V>(r: IResult<&[u8], V>) -> Result<(&[u8], V)> {
|
||||
r.map_err(|_| anyhow!("parse error"))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user