mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-22 21:24:49 +02:00
other: fix clippy warnings (#1712)
This commit is contained in:
parent
d50285075d
commit
69a4b59573
@ -176,7 +176,7 @@ impl StoredData {
|
||||
{
|
||||
match &device.volume_name {
|
||||
Some(volume_name) => Some(volume_name.as_str()),
|
||||
None => device.name.split('/').last(),
|
||||
None => device.name.split('/').next_back(),
|
||||
}
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
@ -187,12 +187,12 @@ impl StoredData {
|
||||
Some(device.name.as_str()) // use the whole zfs
|
||||
// dataset name
|
||||
} else {
|
||||
device.name.split('/').last()
|
||||
device.name.split('/').next_back()
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "zfs"))]
|
||||
{
|
||||
device.name.split('/').last()
|
||||
device.name.split('/').next_back()
|
||||
}
|
||||
}
|
||||
}) else {
|
||||
|
@ -237,7 +237,7 @@ impl Process {
|
||||
let pid = pid_path
|
||||
.as_path()
|
||||
.components()
|
||||
.last()
|
||||
.next_back()
|
||||
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())
|
||||
.or_else(|| {
|
||||
rustix::fs::readlinkat(rustix::fs::CWD, &pid_path, vec![])
|
||||
|
@ -63,13 +63,7 @@ fn convert_rgb_to_color(rgb_str: &str) -> Result<Color, String> {
|
||||
|
||||
let rgb = rgb_list
|
||||
.iter()
|
||||
.filter_map(|val| {
|
||||
if let Ok(res) = (*(*val)).to_string().trim().parse::<u8>() {
|
||||
Some(res)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.filter_map(|val| (*(*val)).to_string().trim().parse::<u8>().ok())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if rgb.len() == 3 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user