use drain_filter
instead of filter
and retain
This commit is contained in:
parent
353d6373ff
commit
4c23905515
2 changed files with 2 additions and 4 deletions
|
@ -1708,10 +1708,7 @@ crate fn show_candidates(
|
|||
|
||||
path_strings.sort();
|
||||
let core_path_strings =
|
||||
path_strings.iter().filter(|p| p.starts_with("core::")).cloned().collect::<Vec<String>>();
|
||||
if !core_path_strings.is_empty() {
|
||||
path_strings.retain(|p| !p.starts_with("core::"));
|
||||
}
|
||||
path_strings.drain_filter(|p| p.starts_with("core::")).collect::<Vec<String>>();
|
||||
path_strings.extend(core_path_strings);
|
||||
path_strings.dedup();
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(drain_filter)]
|
||||
#![feature(bool_to_option)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(format_args_capture)]
|
||||
|
|
Loading…
Add table
Reference in a new issue