mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 05:04:24 +00:00
Rollup merge of #63805 - mati865:clippy, r=Centril
Apply few Clippy suggestions Somewhat follow-up of https://github.com/rust-lang/rust/pull/62806 Changes per commit are rather small so I can squash them if that's preferred.
This commit is contained in:
commit
3068064430
@ -262,7 +262,7 @@ pub fn native_lib_boilerplate(
|
||||
if !up_to_date(Path::new("build.rs"), ×tamp) || !up_to_date(src_dir, ×tamp) {
|
||||
Ok(NativeLibBoilerplate {
|
||||
src_dir: src_dir.to_path_buf(),
|
||||
out_dir: out_dir,
|
||||
out_dir,
|
||||
})
|
||||
} else {
|
||||
Err(())
|
||||
|
@ -1309,7 +1309,7 @@ impl<I> DoubleEndedIterator for Peekable<I> where I: DoubleEndedIterator {
|
||||
Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
|
||||
{
|
||||
match self.peeked.take() {
|
||||
Some(None) => return Try::from_ok(init),
|
||||
Some(None) => Try::from_ok(init),
|
||||
Some(Some(v)) => match self.iter.try_rfold(init, &mut f).into_result() {
|
||||
Ok(acc) => f(acc, v),
|
||||
Err(e) => {
|
||||
@ -1326,7 +1326,7 @@ impl<I> DoubleEndedIterator for Peekable<I> where I: DoubleEndedIterator {
|
||||
where Fold: FnMut(Acc, Self::Item) -> Acc,
|
||||
{
|
||||
match self.peeked {
|
||||
Some(None) => return init,
|
||||
Some(None) => init,
|
||||
Some(Some(v)) => {
|
||||
let acc = self.iter.rfold(init, &mut fold);
|
||||
fold(acc, v)
|
||||
|
@ -3026,8 +3026,7 @@ macro_rules! len {
|
||||
if size == 0 {
|
||||
// This _cannot_ use `unchecked_sub` because we depend on wrapping
|
||||
// to represent the length of long ZST slice iterators.
|
||||
let diff = ($self.end as usize).wrapping_sub(start as usize);
|
||||
diff
|
||||
($self.end as usize).wrapping_sub(start as usize)
|
||||
} else {
|
||||
// We know that `start <= end`, so can do better than `offset_from`,
|
||||
// which needs to deal in signed. By setting appropriate flags here
|
||||
|
Loading…
Reference in New Issue
Block a user