comparison rust/rhg/src/commands/debugrhgsparse.rs @ 49914:58074252db3c

rust: run `cargo clippy` These automatic fixes are good to have because they make the code more idiomatic and less surprising. The transform from `sort` -> `sort_unstable` is questionable, but this is only in a test, so it doesn't matter in our case.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 09 Jan 2023 17:40:03 +0100
parents 37bc3edef76f
children
comparison
equal deleted inserted replaced
49913:c15b415d1bff 49914:58074252db3c
22 } 22 }
23 23
24 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { 24 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
25 let repo = invocation.repo?; 25 let repo = invocation.repo?;
26 26
27 let (matcher, _warnings) = hg::sparse::matcher(&repo).unwrap(); 27 let (matcher, _warnings) = hg::sparse::matcher(repo).unwrap();
28 let files = invocation.subcommand_args.get_many::<OsString>("files"); 28 let files = invocation.subcommand_args.get_many::<OsString>("files");
29 if let Some(files) = files { 29 if let Some(files) = files {
30 let files: Vec<&OsStr> = files 30 let files: Vec<&OsStr> = files
31 .filter(|s| !s.is_empty()) 31 .filter(|s| !s.is_empty())
32 .map(|s| s.as_os_str()) 32 .map(|s| s.as_os_str())