Skip to content
Myr

Run cargo fmt

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

authored by sharkdp · committed by David Peter · parent 59c9901 · Browse files · 3 files+20 added−40 removed
This commit

State

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

Diff stats

3 files+20 added−40 removed

  • tests:+3 added−6 removed
  • other:+17 added−34 removed

3 files+20 added−40 removed

modified:src/app.rs+14 added-28 removed
48 unmodified lines
49 arg("rg-alias-hidden-ignore")50 .short("u")51 .multiple(true)52 .hidden(true),53 )54 .arg(53 ).arg(54 arg("case-sensitive")55 .long("case-sensitive")56 .short("s")57 .overrides_with("ignore-case"),59 )60 .arg(58 ).arg(59 arg("ignore-case")60 .long("ignore-case")61 .short("i")62 .overrides_with("case-sensitive"),65 )66 .arg(63 ).arg(64 arg("fixed-strings")65 .long("fixed-strings")66 .short("F")67 .alias("literal"),71 )72 .arg(arg("absolute-path").long("absolute-path").short("a"))68 ).arg(arg("absolute-path").long("absolute-path").short("a"))69 .arg(arg("follow").long("follow").short("L").alias("dereference"))70 .arg(arg("full-path").long("full-path").short("p"))71 .arg(arg("null_separator").long("print0").short("0"))72 .arg(arg("depth").long("max-depth").short("d").takes_value(true))
13 unmodified lines
86 "l",87 "symlink",88 "x",89 "executable",94 ])95 .hide_possible_values(true),96 )90 ]).hide_possible_values(true),91 ).arg(97 .arg(92 arg("extension")93 .long("extension")94 .short("e")95 .multiple(true)96 .number_of_values(1)97 .takes_value(true)98 .value_name("ext"),105 )106 .arg(99 ).arg(100 arg("exec")101 .long("exec")102 .short("x")103 .min_values(1)104 .allow_hyphen_values(true)105 .value_terminator(";")106 .value_name("cmd"),114 )115 .arg(107 ).arg(108 arg("exclude")109 .long("exclude")110 .short("E")111 .takes_value(true)112 .value_name("pattern")113 .number_of_values(1)114 .multiple(true),123 )124 .arg(115 ).arg(116 arg("ignore-file")117 .long("ignore-file")118 .takes_value(true)119 .value_name("path")120 .number_of_values(1)121 .multiple(true),131 )132 .arg(122 ).arg(123 arg("color")124 .long("color")125 .short("c")126 .takes_value(true)127 .value_name("when")128 .possible_values(&["never", "auto", "always"])129 .hide_possible_values(true),140 )141 .arg(130 ).arg(131 arg("threads")132 .long("threads")133 .short("j")134 .takes_value(true)135 .value_name("num"),147 )148 .arg(136 ).arg(137 arg("size")138 .long("size")139 .short("S")140 .takes_value(true)141 .number_of_values(1)142 .allow_hyphen_values(true)143 .multiple(true),156 )157 .arg(144 ).arg(145 arg("max-buffer-time")146 .long("max-buffer-time")147 .takes_value(true)148 .hidden(true),162 )163 .arg(arg("pattern"))149 ).arg(arg("pattern"))150 .arg(arg("path").multiple(true))151}152153#[cfg_attr(rustfmt, rustfmt_skip)]
116 unmodified lines
modified:src/main.rs+3 added-6 removed
65 unmodified lines
66 path_buffer.to_string_lossy()67 ));68 }69 path_buffer70 })71 .collect::<Vec<_>>(),70 }).collect::<Vec<_>>(),71 None => vec![current_dir.to_path_buf()],72 };7374 if matches.is_present("absolute-path") {
3 unmodified lines
78 path_buffer79 .canonicalize()80 .and_then(|pb| fshelper::absolute_path(pb.as_path()))81 .unwrap()83 })84 .collect();82 }).collect();83 }8485 // Detect if the user accidentally supplied a path instead of a search pattern86 if !matches.is_present("full-path")
54 unmodified lines
141 return f;142 }143 error(&format!("Error: {} is not a valid size constraint.", sf));144 }).collect()147 })148 .unwrap_or_else(|| vec![]);145 }).unwrap_or_else(|| vec![]);146147 let config = FdOptions {148 case_sensitive,149 search_full_path: matches.is_present("full-path"),
79 unmodified lines
modified:tests/testenv/mod.rs+3 added-6 removed
104 unmodified lines
105 .map(|diff| match diff {106 diff::Result::Left(l) => format!("-{}", l),107 diff::Result::Both(l, _) => format!(" {}", l),108 diff::Result::Right(r) => format!("+{}", r),109 })110 .collect::<Vec<_>>()109 }).collect::<Vec<_>>()110 .join("\n");111112 format!(113 concat!(
11 unmodified lines
125 let mut lines = s126 .replace('\0', "NULL\n")127 .lines()128 .map(|line| {130 let line =131 if trim_left { line.trim_left() } else { line };129 let line = if trim_left { line.trim_left() } else { line };130 line.replace('/', &std::path::MAIN_SEPARATOR.to_string())133 })134 .collect::<Vec<_>>();131 }).collect::<Vec<_>>();132133 lines.sort_by_key(|s| s.clone());134135 lines.join("\n")
60 unmodified lines