mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
chore(Rust): removes use of + with Vec<T>
This commit is contained in:
parent
58c8e2d44f
commit
da78da3620
1 changed files with 11 additions and 2 deletions
13
src/app.rs
13
src/app.rs
|
@ -737,7 +737,13 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
|
|||
if g_vec.is_empty() {
|
||||
return args.iter().map(|s| s.to_owned()).collect()
|
||||
}
|
||||
return g_vec.iter().map(|g| self.get_group_members(g)).fold(vec![], |acc, v| acc + &v)
|
||||
return g_vec.iter()
|
||||
.map(|g| self.get_group_members(g))
|
||||
.fold(vec![], |mut acc, v| {
|
||||
v.into_iter().map(|i| acc.push(i)).collect::<Vec<_>>();
|
||||
acc
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
fn get_group_members_names(&self, group: &'ar str) -> Vec<&'ar str> {
|
||||
|
@ -763,7 +769,10 @@ impl<'a, 'v, 'ab, 'u, 'h, 'ar> App<'a, 'v, 'ab, 'u, 'h, 'ar>{
|
|||
}
|
||||
return g_vec.iter()
|
||||
.map(|g| self.get_group_members_names(g))
|
||||
.fold(vec![], |acc, v| acc + &v)
|
||||
.fold(vec![], |mut acc, v| {
|
||||
v.into_iter().map(|i| acc.push(i)).collect::<Vec<_>>();
|
||||
acc
|
||||
})
|
||||
}
|
||||
|
||||
fn get_required_from(&self, reqs: HashSet<&'ar str>) -> VecDeque<String> {
|
||||
|
|
Loading…
Reference in a new issue