mirror of https://github.com/sharkdp/fd.git
Merge pull request #1536 from bin-ly/master
Use 'MAIN_SEPARATOR_STR' instead of '&MAIN_SEPARATOR.to_string()'
This commit is contained in:
commit
3cd73d7927
|
@ -34,10 +34,10 @@ pub fn dirname(path: &Path) -> OsString {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod path_tests {
|
mod path_tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::path::MAIN_SEPARATOR;
|
use std::path::MAIN_SEPARATOR_STR;
|
||||||
|
|
||||||
fn correct(input: &str) -> String {
|
fn correct(input: &str) -> String {
|
||||||
input.replace('/', &MAIN_SEPARATOR.to_string())
|
input.replace('/', MAIN_SEPARATOR_STR)
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! func_tests {
|
macro_rules! func_tests {
|
||||||
|
|
|
@ -129,7 +129,7 @@ fn normalize_output(s: &str, trim_start: bool, normalize_line: bool) -> String {
|
||||||
.lines()
|
.lines()
|
||||||
.map(|line| {
|
.map(|line| {
|
||||||
let line = if trim_start { line.trim_start() } else { 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 {
|
if normalize_line {
|
||||||
let mut words: Vec<_> = line.split_whitespace().collect();
|
let mut words: Vec<_> = line.split_whitespace().collect();
|
||||||
words.sort_unstable();
|
words.sort_unstable();
|
||||||
|
|
Loading…
Reference in New Issue