diff options
author | binlingyu <binlingyu@uniontech.com> | 2024-04-15 10:36:10 +0800 |
---|---|---|
committer | binlingyu <binlingyu@uniontech.com> | 2024-04-15 10:36:10 +0800 |
commit | 7794c4aae5abdd215d8879136e4f536fd086ff17 (patch) | |
tree | fad14107cc054b1fd9b2dc2672a27fe43e19c6ff | |
parent | 8c7a84ea30fefd1258e37d5f20a8c75fd77d48f9 (diff) |
Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()'
-rw-r--r-- | src/exec/input.rs | 4 | ||||
-rw-r--r-- | tests/testenv/mod.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/exec/input.rs b/src/exec/input.rs index af7ba25..a599432 100644 --- a/src/exec/input.rs +++ b/src/exec/input.rs @@ -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 { diff --git a/tests/testenv/mod.rs b/tests/testenv/mod.rs index 188559d..c39fa69 100644 --- a/tests/testenv/mod.rs +++ b/tests/testenv/mod.rs @@ -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(); |