fix(style): replace sort_by with sort_by_key (#1089)

This commit is contained in:
Ken Matsui 2022-02-24 19:03:03 +09:00 committed by GitHub
parent 5c4e5d70b8
commit 21df45cf22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,7 @@ use crate::{
};
use serde::{Deserialize, Serialize};
use std::cell::RefCell;
use std::cmp::Reverse;
use std::os::unix::io::RawFd;
use std::rc::Rc;
use std::sync::mpsc::channel;
@ -1328,7 +1329,7 @@ impl Tab {
.iter()
.map(|p_id| self.panes.get(p_id).unwrap())
.collect();
panes.sort_by(|a, b| b.active_at().cmp(&a.active_at()));
panes.sort_by_key(|b| Reverse(b.active_at()));
panes.iter().find(|pane| pane.selectable()).map(|p| p.pid())
}