clippy: fix warnings from

double_ended_iterator_last lint
This commit is contained in:
Daniel Hofstetter
2025-04-03 17:02:52 +02:00
parent 1d9347ecd2
commit c597cc699b
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -79,7 +79,7 @@ impl TryFrom<PathBuf> for Teletype {
let f = |prefix: &str| {
value
.iter()
.last()?
.next_back()?
.to_str()?
.strip_prefix(prefix)?
.parse::<u64>()
@@ -229,7 +229,7 @@ impl ProcessInformation {
let pid = {
value
.iter()
.last()
.next_back()
.ok_or(io::ErrorKind::Other)?
.to_str()
.ok_or(io::ErrorKind::InvalidData)?
+1 -1
View File
@@ -213,7 +213,7 @@ fn construct_verbose_result(pids: &[u32], action_results: &[Option<ActionResult>
let mut cmd = process
.exe()
.and_then(|it| it.iter().last())
.and_then(|it| it.iter().next_back())
.unwrap_or("?".as_ref());
let cmd = cmd.to_str().unwrap();
+1 -1
View File
@@ -193,7 +193,7 @@ fn command(pid: u32) -> String {
};
proc.exe()
.and_then(|it| it.iter().last())
.and_then(|it| it.iter().next_back())
.map(|it| it.to_str().unwrap())
.unwrap_or(&f(proc.cmd()))
.into()