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:
Ade Attwood 2024-07-23 22:10:50 +01:00
parent f7e9b84d95
commit 3586c8d88e

View file

@ -65,21 +65,18 @@ impl Config {
self.imap_stores
.iter()
.find(|store| format!(":{}:", store.name) == name)
.map(|store| store.clone())
.cloned()
}
pub fn find_channel(&self, name: &str) -> Option<ChannelConfig> {
self.channels
.iter()
.find(|channel| channel.name == name)
.map(|channel| channel.clone())
.cloned()
}
pub fn find_group(&self, name: &str) -> Option<GroupConfig> {
self.groups
.iter()
.find(|group| group.name == name)
.map(|group| group.clone())
self.groups.iter().find(|group| group.name == name).cloned()
}
}