Clear clippy 1.97 lints across bread-theme, bread-utils, bread-polkit
Toolchain drift (clippy 0.1.97): pre-existing on main, all mechanical and behaviour-preserving. - bread-theme/gtk.rs: `type AppCssBuilder` alias for the repeated `Rc<dyn Fn(&Palette) -> String>` (type_complexity ×4). - bread-theme/lib.rs: `sort_by_key(|..| Reverse(len))` (unnecessary_sort_by). - bread-theme/output.rs: `io::Error::other`; struct-init in a test. - bread-utils/singleton.rs: explicit `.truncate(false)` on the lock file open — we only clear it after winning the lock (suspicious_open_options). - bread-polkit/identity.rs: elide `pick_user` lifetimes.
This commit is contained in:
parent
6d9912af56
commit
a86c31291b
5 changed files with 24 additions and 15 deletions
|
|
@ -37,7 +37,7 @@ pub fn users_from_uids(uids: &[u32], passwd: &str) -> Vec<UnixUser> {
|
|||
}
|
||||
|
||||
/// Prefer the process's own uid when it is in `users`, otherwise the first.
|
||||
pub fn pick_user<'a>(users: &'a [UnixUser], current_uid: Option<u32>) -> Option<&'a UnixUser> {
|
||||
pub fn pick_user(users: &[UnixUser], current_uid: Option<u32>) -> Option<&UnixUser> {
|
||||
if let Some(uid) = current_uid {
|
||||
if let Some(user) = users.iter().find(|u| u.uid == uid) {
|
||||
return Some(user);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue