mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 05:34:57 +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 {
|
match &device.volume_name {
|
||||||
Some(volume_name) => Some(volume_name.as_str()),
|
Some(volume_name) => Some(volume_name.as_str()),
|
||||||
None => device.name.split('/').last(),
|
None => device.name.split('/').next_back(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
@ -187,12 +187,12 @@ impl StoredData {
|
|||||||
Some(device.name.as_str()) // use the whole zfs
|
Some(device.name.as_str()) // use the whole zfs
|
||||||
// dataset name
|
// dataset name
|
||||||
} else {
|
} else {
|
||||||
device.name.split('/').last()
|
device.name.split('/').next_back()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(not(feature = "zfs"))]
|
#[cfg(not(feature = "zfs"))]
|
||||||
{
|
{
|
||||||
device.name.split('/').last()
|
device.name.split('/').next_back()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}) else {
|
}) else {
|
||||||
|
@ -237,7 +237,7 @@ impl Process {
|
|||||||
let pid = pid_path
|
let pid = pid_path
|
||||||
.as_path()
|
.as_path()
|
||||||
.components()
|
.components()
|
||||||
.last()
|
.next_back()
|
||||||
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())
|
.and_then(|s| s.to_string_lossy().parse::<Pid>().ok())
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
rustix::fs::readlinkat(rustix::fs::CWD, &pid_path, vec![])
|
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
|
let rgb = rgb_list
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|val| {
|
.filter_map(|val| (*(*val)).to_string().trim().parse::<u8>().ok())
|
||||||
if let Ok(res) = (*(*val)).to_string().trim().parse::<u8>() {
|
|
||||||
Some(res)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
if rgb.len() == 3 {
|
if rgb.len() == 3 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user