Use next_back() instead of last()

Fixes a new Clippy warning.
This commit is contained in:
Tavian Barnes
2025-04-24 10:01:06 -04:00
parent 16b46710ee
commit 3651f86162
+1 -1
View File
@@ -137,7 +137,7 @@ impl Colorable for DirEntry {
// but we want it for all component types, so we open code it.
// Copied from LsColors::style_for_path_with_metadata().
path.components()
.last()
.next_back()
.map(|c| c.as_os_str())
.unwrap_or_else(|| path.as_os_str())
}