[cache_dump] Squash some clippy warnings

This commit is contained in:
Joe Thornber 2021-03-03 09:48:15 +00:00
parent 3cf0dba469
commit fdcc09c27e
4 changed files with 7 additions and 7 deletions

4
src/cache/check.rs vendored
View File

@ -35,7 +35,7 @@ impl CheckMappingVisitor {
fn seen_oblock(&self, b: u64) -> bool { fn seen_oblock(&self, b: u64) -> bool {
let seen_oblocks = self.seen_oblocks.lock().unwrap(); let seen_oblocks = self.seen_oblocks.lock().unwrap();
return seen_oblocks.contains(&b); seen_oblocks.contains(&b)
} }
fn record_oblock(&self, b: u64) { fn record_oblock(&self, b: u64) {
@ -46,7 +46,7 @@ impl CheckMappingVisitor {
// FIXME: is it possible to validate flags at an early phase? // FIXME: is it possible to validate flags at an early phase?
// e.g., move to ctor of Mapping? // e.g., move to ctor of Mapping?
fn has_unknown_flags(&self, m: &Mapping) -> bool { 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
View File

@ -23,7 +23,7 @@ struct MappingEmitter {
impl MappingEmitter { impl MappingEmitter {
pub fn new(emitter: Arc<Mutex<dyn MetadataVisitor>>) -> MappingEmitter { pub fn new(emitter: Arc<Mutex<dyn MetadataVisitor>>) -> MappingEmitter {
MappingEmitter { MappingEmitter {
emitter: emitter, emitter,
} }
} }
} }
@ -58,7 +58,7 @@ struct HintEmitter<Width> {
impl<Width> HintEmitter<Width> { impl<Width> HintEmitter<Width> {
pub fn new(emitter: Arc<Mutex<dyn MetadataVisitor>>) -> HintEmitter<Width> { pub fn new(emitter: Arc<Mutex<dyn MetadataVisitor>>) -> HintEmitter<Width> {
HintEmitter { HintEmitter {
emitter: emitter, emitter,
_not_used: PhantomData, _not_used: PhantomData,
} }
} }

View File

@ -22,11 +22,11 @@ pub struct Mapping {
impl Mapping { impl Mapping {
pub fn is_valid(&self) -> bool { 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 { pub fn is_dirty(&self) -> bool {
return (self.flags & MappingFlags::Dirty as u32) != 0; (self.flags & MappingFlags::Dirty as u32) != 0
} }
} }

View File

@ -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")) r.map_err(|_| anyhow!("parse error"))
} }