Skip to content

Commit

Permalink
clippy learned some new tricks
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Oct 7, 2022
1 parent 8c41f67 commit dc0faf3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)]
Expand Down
2 changes: 1 addition & 1 deletion src/shims/unix/android/dlsym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
);
}

let &[ref _sig, ref _func] = check_arg_count(args)?;
let [_sig, _func] = check_arg_count(args)?;
this.write_null(dest)?;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/shims/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,23 +1073,23 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
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
.map(|tup| {
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
.map(|tup| {
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(
Expand Down
1 change: 1 addition & 0 deletions src/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl SbTag {
}

// The default to be used when SB is disabled
#[allow(clippy::should_implement_trait)]
pub fn default() -> Self {
Self::new(1).unwrap()
}
Expand Down

0 comments on commit dc0faf3

Please sign in to comment.