Skip to content

Commit 3068064

Browse files
authored
Rollup merge of #63805 - mati865:clippy, r=Centril
Apply few Clippy suggestions Somewhat follow-up of #62806 Changes per commit are rather small so I can squash them if that's preferred.
2 parents aa9490b + edabcdd commit 3068064

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/build_helper/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub fn native_lib_boilerplate(
262262
if !up_to_date(Path::new("build.rs"), &timestamp) || !up_to_date(src_dir, &timestamp) {
263263
Ok(NativeLibBoilerplate {
264264
src_dir: src_dir.to_path_buf(),
265-
out_dir: out_dir,
265+
out_dir,
266266
})
267267
} else {
268268
Err(())

src/libcore/iter/adapters/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ impl<I> DoubleEndedIterator for Peekable<I> where I: DoubleEndedIterator {
13091309
Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
13101310
{
13111311
match self.peeked.take() {
1312-
Some(None) => return Try::from_ok(init),
1312+
Some(None) => Try::from_ok(init),
13131313
Some(Some(v)) => match self.iter.try_rfold(init, &mut f).into_result() {
13141314
Ok(acc) => f(acc, v),
13151315
Err(e) => {
@@ -1326,7 +1326,7 @@ impl<I> DoubleEndedIterator for Peekable<I> where I: DoubleEndedIterator {
13261326
where Fold: FnMut(Acc, Self::Item) -> Acc,
13271327
{
13281328
match self.peeked {
1329-
Some(None) => return init,
1329+
Some(None) => init,
13301330
Some(Some(v)) => {
13311331
let acc = self.iter.rfold(init, &mut fold);
13321332
fold(acc, v)

src/libcore/slice/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3026,8 +3026,7 @@ macro_rules! len {
30263026
if size == 0 {
30273027
// This _cannot_ use `unchecked_sub` because we depend on wrapping
30283028
// to represent the length of long ZST slice iterators.
3029-
let diff = ($self.end as usize).wrapping_sub(start as usize);
3030-
diff
3029+
($self.end as usize).wrapping_sub(start as usize)
30313030
} else {
30323031
// We know that `start <= end`, so can do better than `offset_from`,
30333032
// which needs to deal in signed. By setting appropriate flags here

0 commit comments

Comments
 (0)