refactor: do not get domains as often
This commit is contained in:
parent
d2fa95d1e4
commit
d82dbfdd43
1 changed files with 1 additions and 1 deletions
|
|
@ -30,7 +30,7 @@ async fn complete_channel(mut channel: Channel, client: &Client) -> Result<Box<C
|
|||
let grouped: Vec<(Option<String>, Vec<rss::Item>)> = channel
|
||||
.items()
|
||||
.iter()
|
||||
.sorted_by(|a, b| get_domain(a).cmp(&get_domain(b)))
|
||||
.sorted_by_cached_key(|a| get_domain(a))
|
||||
.chunk_by(|&item| get_domain(item))
|
||||
.into_iter()
|
||||
.map(|(k, v)| (k, v.cloned().collect()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue