diff options
| author | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2024-09-08 21:51:00 +0200 |
|---|---|---|
| committer | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2024-09-08 21:51:00 +0200 |
| commit | 5f3fdd14dfc47b0c6ab7f5887052d6e628b56919 (patch) | |
| tree | 7eaafedac065284edf95338a0598b3cb553956fb /library/alloc/src/vec | |
| parent | adf8d168af9334a8bf940824fcf4207d01e05ae5 (diff) | |
Remove needless returns detected by clippy in libraries
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/in_place_collect.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/vec/into_iter.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/library/alloc/src/vec/in_place_collect.rs b/library/alloc/src/vec/in_place_collect.rs index d119e6ca397..ec0ab8ee728 100644 --- a/library/alloc/src/vec/in_place_collect.rs +++ b/library/alloc/src/vec/in_place_collect.rs @@ -208,7 +208,7 @@ const fn needs_realloc<SRC, DEST>(src_cap: usize, dst_cap: usize) -> bool { // type layouts don't guarantee a fit, so do a runtime check to see if // the allocations happen to match - return src_cap > 0 && src_cap * mem::size_of::<SRC>() != dst_cap * mem::size_of::<DEST>(); + src_cap > 0 && src_cap * mem::size_of::<SRC>() != dst_cap * mem::size_of::<DEST>() } /// This provides a shorthand for the source type since local type aliases aren't a thing. diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs index fad8abad493..92c5e360da4 100644 --- a/library/alloc/src/vec/into_iter.rs +++ b/library/alloc/src/vec/into_iter.rs @@ -288,11 +288,11 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> { // Safety: `len` is larger than the array size. Copy a fixed amount here to fully initialize // the array. - return unsafe { + unsafe { ptr::copy_nonoverlapping(self.ptr.as_ptr(), raw_ary.as_mut_ptr() as *mut T, N); self.ptr = self.ptr.add(N); Ok(raw_ary.transpose().assume_init()) - }; + } } fn fold<B, F>(mut self, mut accum: B, mut f: F) -> B |
