Skip to content

Commit abf4e47

Browse files
authored
Merge pull request #1712 from sharkdp/next-back
Use next_back() instead of last()
2 parents 16b4671 + 5c0c86c commit abf4e47

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/CICD.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
ensure_cargo_fmt:
3838
name: Ensure 'cargo fmt' has been run
39-
runs-on: ubuntu-20.04
39+
runs-on: ubuntu-22.04
4040
steps:
4141
- uses: dtolnay/rust-toolchain@stable
4242
with:
@@ -56,7 +56,7 @@ jobs:
5656

5757
min_version:
5858
name: Minimum supported rust version
59-
runs-on: ubuntu-20.04
59+
runs-on: ubuntu-22.04
6060
needs: crate_metadata
6161
steps:
6262
- name: Checkout source code

src/dir_entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl Colorable for DirEntry {
137137
// but we want it for all component types, so we open code it.
138138
// Copied from LsColors::style_for_path_with_metadata().
139139
path.components()
140-
.last()
140+
.next_back()
141141
.map(|c| c.as_os_str())
142142
.unwrap_or_else(|| path.as_os_str())
143143
}

0 commit comments

Comments
 (0)