clippy learned some new tricks
This commit is contained in:
parent
c2adc2e234
commit
58b13b7b88
@ -28,6 +28,7 @@
|
||||
clippy::type_complexity,
|
||||
clippy::single_element_loop,
|
||||
clippy::needless_return,
|
||||
clippy::bool_to_int_with_if,
|
||||
// We are not implementing queries here so it's fine
|
||||
rustc::potential_query_instability
|
||||
)]
|
||||
|
@ -42,7 +42,7 @@ fn call_dlsym(
|
||||
);
|
||||
}
|
||||
|
||||
let &[ref _sig, ref _func] = check_arg_count(args)?;
|
||||
let [_sig, _func] = check_arg_count(args)?;
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
}
|
||||
|
@ -1073,7 +1073,7 @@ fn linux_statx(
|
||||
mask |= this.eval_libc("STATX_ATIME")?.to_u32()?;
|
||||
InterpResult::Ok(tup)
|
||||
})
|
||||
.unwrap_or(Ok((0, 0)))?;
|
||||
.unwrap_or_else(|| Ok((0, 0)))?;
|
||||
|
||||
let (created_sec, created_nsec) = metadata
|
||||
.created
|
||||
@ -1081,7 +1081,7 @@ fn linux_statx(
|
||||
mask |= this.eval_libc("STATX_BTIME")?.to_u32()?;
|
||||
InterpResult::Ok(tup)
|
||||
})
|
||||
.unwrap_or(Ok((0, 0)))?;
|
||||
.unwrap_or_else(|| Ok((0, 0)))?;
|
||||
|
||||
let (modified_sec, modified_nsec) = metadata
|
||||
.modified
|
||||
@ -1089,7 +1089,7 @@ fn linux_statx(
|
||||
mask |= this.eval_libc("STATX_MTIME")?.to_u32()?;
|
||||
InterpResult::Ok(tup)
|
||||
})
|
||||
.unwrap_or(Ok((0, 0)))?;
|
||||
.unwrap_or_else(|| Ok((0, 0)))?;
|
||||
|
||||
// Now we write everything to `statxbuf`. We write a zero for the unavailable fields.
|
||||
this.write_int_fields_named(
|
||||
|
@ -45,6 +45,7 @@ pub fn new(i: u64) -> Option<Self> {
|
||||
}
|
||||
|
||||
// The default to be used when SB is disabled
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
pub fn default() -> Self {
|
||||
Self::new(1).unwrap()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user