You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code RA suggests replacing filter_map().next() with find_map(), however find_map() requires Self to be Sized (why is beyond me) so actually running this replacement produces code that doesn't compile. Clippy does not offer this suggestion. Tried on stable and preview VSCode plugin.
let mut j = [0].into_iter();
let i: &mut dyn Iterator<Item = i32> = &mut j;
let dummy_fn = |v| (v > 0).then_some(v + 1);
let _res = i.filter_map(dummy_fn).next();
The text was updated successfully, but these errors were encountered:
The problem here is the difference between next and find_map wrt to Self::Sized (the latte probably requires it due to the use of try_fold). We shouldn't show the lint here 👍
rust-analyzer version: 0.3.1839-standalone (c06ca6c 2024-02-11)
rust-analyzer version: 0.4.1843-standalone (b9b0d29 2024-02-15)
rustc version: rustc 1.76.0 (07dca489a 2024-02-04)
relevant settings: N/A
In the following code RA suggests replacing
filter_map().next()
withfind_map()
, howeverfind_map()
requiresSelf
to beSized
(why is beyond me) so actually running this replacement produces code that doesn't compile. Clippy does not offer this suggestion. Tried on stable and preview VSCode plugin.The text was updated successfully, but these errors were encountered: