diff --git a/src/cache/check.rs b/src/cache/check.rs index 92895e1..5f9d295 100644 --- a/src/cache/check.rs +++ b/src/cache/check.rs @@ -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 } } diff --git a/src/cache/dump.rs b/src/cache/dump.rs index 566673f..fc2714a 100644 --- a/src/cache/dump.rs +++ b/src/cache/dump.rs @@ -23,7 +23,7 @@ struct MappingEmitter { impl MappingEmitter { pub fn new(emitter: Arc>) -> MappingEmitter { MappingEmitter { - emitter: emitter, + emitter, } } } @@ -58,7 +58,7 @@ struct HintEmitter { impl HintEmitter { pub fn new(emitter: Arc>) -> HintEmitter { HintEmitter { - emitter: emitter, + emitter, _not_used: PhantomData, } } diff --git a/src/cache/mapping.rs b/src/cache/mapping.rs index 7ee8768..4919ce5 100644 --- a/src/cache/mapping.rs +++ b/src/cache/mapping.rs @@ -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 } } diff --git a/src/pdata/array_block.rs b/src/pdata/array_block.rs index 0cf7069..ad52bba 100644 --- a/src/pdata/array_block.rs +++ b/src/pdata/array_block.rs @@ -50,7 +50,7 @@ impl ArrayBlock { } } -fn convert_result<'a, V>(r: IResult<&'a [u8], V>) -> Result<(&'a [u8], V)> { +fn convert_result(r: IResult<&[u8], V>) -> Result<(&[u8], V)> { r.map_err(|_| anyhow!("parse error")) }