Compare commits

...

4 Commits

Author SHA1 Message Date
Thayne McCombs 4268c602d6
Merge e13693a4a6 into 3cd73d7927 2024-04-15 04:17:55 +00:00
Thayne McCombs e13693a4a6 Add clippy using latest rust version to CI
Fixes: #1511
2024-04-14 22:17:49 -06:00
Thayne McCombs 3cd73d7927
Merge pull request #1536 from bin-ly/master
Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()'
2024-04-14 20:58:12 -06:00
binlingyu 7794c4aae5 Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()' 2024-04-15 10:36:10 +08:00
3 changed files with 13 additions and 3 deletions

View File

@ -44,6 +44,16 @@ jobs:
- uses: actions/checkout@v4
- run: cargo fmt -- --check
lint_check:
name: Ensure 'cargo clippy' has no warnings
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: actions/checkout@v4
- run: cargo clippy --all-targets --all-features -- -Dwarnings
min_version:
name: Minimum supported rust version
runs-on: ubuntu-20.04

View File

@ -34,10 +34,10 @@ pub fn dirname(path: &Path) -> OsString {
#[cfg(test)]
mod path_tests {
use super::*;
use std::path::MAIN_SEPARATOR;
use std::path::MAIN_SEPARATOR_STR;
fn correct(input: &str) -> String {
input.replace('/', &MAIN_SEPARATOR.to_string())
input.replace('/', MAIN_SEPARATOR_STR)
}
macro_rules! func_tests {

View File

@ -129,7 +129,7 @@ fn normalize_output(s: &str, trim_start: bool, normalize_line: bool) -> String {
.lines()
.map(|line| {
let line = if trim_start { line.trim_start() } else { line };
let line = line.replace('/', &std::path::MAIN_SEPARATOR.to_string());
let line = line.replace('/', std::path::MAIN_SEPARATOR_STR);
if normalize_line {
let mut words: Vec<_> = line.split_whitespace().collect();
words.sort_unstable();