Skip to content
Myr

Merge pull request #1712 from sharkdp/next-back

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Use next_back() instead of last()

authored by Thayne McCombs · committed by GitHub · parents 16b4671, 5c0c86c · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:.github/workflows/CICD.yml+2 added-2 removed
34 unmodified lines
35 msrv: ${{ steps.crate_metadata.outputs.msrv }}3637 ensure_cargo_fmt:38 name: Ensure 'cargo fmt' has been run39 runs-on: ubuntu-20.0439 runs-on: ubuntu-22.0440 steps:41 - uses: dtolnay/rust-toolchain@stable42 with:43 components: rustfmt
11 unmodified lines
55 - run: cargo clippy --all-targets --all-features -- -Dwarnings5657 min_version:58 name: Minimum supported rust version59 runs-on: ubuntu-20.0459 runs-on: ubuntu-22.0460 needs: crate_metadata61 steps:62 - name: Checkout source code63 uses: actions/checkout@v4
202 unmodified lines
modified:src/dir_entry.rs+1 added-1 removed
135 unmodified lines
136 // Path::file_name() only works if the last component is Normal,137 // but we want it for all component types, so we open code it.138 // Copied from LsColors::style_for_path_with_metadata().139 path.components()140 .last()140 .next_back()141 .map(|c| c.as_os_str())142 .unwrap_or_else(|| path.as_os_str())143 }144 };
11 unmodified lines