From 1ceb45540bc117d28cc41d90cc0a4129fb4c0f2c Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Sat, 6 Jul 2024 09:29:29 -0400 Subject: [PATCH] Remove unused type parameter in `Parallel::drain()` (#14178) # Objective - `Parallel::drain()` has an unused type parameter `B` than can be removed. - Caught [on Discord](https://discord.com/channels/691052431525675048/692572690833473578/1259004180560085003) by Andrew, thanks! ## Solution - Remove it! :) ## Testing - `Parallel::drain()` should still function exactly the same. --- ## Changelog - Removed unused type parameter in `Parallel::drain()`. ## Migration Guide The type parameter of `Parallel::drain()` was unused, so it is now removed. If you were manually specifying it, you can remove the bounds. ```rust // 0.14 // Create a `Parallel` and give it a value. let mut parallel: Parallel> = Parallel::default(); *parallel.borrow_local_mut() = vec![1, 2, 3]; for v in parallel.drain::() { // ... } // 0.15 let mut parallel: Parallel> = Parallel::default(); *parallel.borrow_local_mut() = vec![1, 2, 3]; // Remove the type parameter. for v in parallel.drain() { // ... } ``` --- crates/bevy_utils/src/parallel_queue.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/bevy_utils/src/parallel_queue.rs b/crates/bevy_utils/src/parallel_queue.rs index 2126f74104974..61741da4f2205 100644 --- a/crates/bevy_utils/src/parallel_queue.rs +++ b/crates/bevy_utils/src/parallel_queue.rs @@ -51,10 +51,7 @@ where /// chunk will be dropped, and the rest of the undrained elements will remain. /// /// The ordering is not guaranteed. - pub fn drain(&mut self) -> impl Iterator + '_ - where - B: FromIterator, - { + pub fn drain(&mut self) -> impl Iterator + '_ { self.locals.iter_mut().flat_map(|item| item.take()) } }