Skip to content

Commit

Permalink
Merge pull request #1536 from bin-ly/master
Browse files Browse the repository at this point in the history
Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()'
  • Loading branch information
tmccombs authored Apr 15, 2024
2 parents 8c7a84e + 7794c4a commit 3cd73d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/exec/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/testenv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3cd73d7

Please sign in to comment.