chore: clippy suggestion replace map with cloned
Summary: This is a clippy suggestion. > consider calling the dedicated `cloned` method Test Plan: This has been tested locally Reviewers: AdeAttwood Reviewed By: AdeAttwood Differential Revision: https://ph.baln.co.uk/D6
This commit is contained in:
parent
f7e9b84d95
commit
3586c8d88e
1 changed files with 3 additions and 6 deletions
|
|
@ -65,21 +65,18 @@ impl Config {
|
||||||
self.imap_stores
|
self.imap_stores
|
||||||
.iter()
|
.iter()
|
||||||
.find(|store| format!(":{}:", store.name) == name)
|
.find(|store| format!(":{}:", store.name) == name)
|
||||||
.map(|store| store.clone())
|
.cloned()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find_channel(&self, name: &str) -> Option<ChannelConfig> {
|
pub fn find_channel(&self, name: &str) -> Option<ChannelConfig> {
|
||||||
self.channels
|
self.channels
|
||||||
.iter()
|
.iter()
|
||||||
.find(|channel| channel.name == name)
|
.find(|channel| channel.name == name)
|
||||||
.map(|channel| channel.clone())
|
.cloned()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find_group(&self, name: &str) -> Option<GroupConfig> {
|
pub fn find_group(&self, name: &str) -> Option<GroupConfig> {
|
||||||
self.groups
|
self.groups.iter().find(|group| group.name == name).cloned()
|
||||||
.iter()
|
|
||||||
.find(|group| group.name == name)
|
|
||||||
.map(|group| group.clone())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue