mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-04 21:52:54 +02:00
style: simplify string formatting
Most of this code was written before this was supported by Rust. Closes #2912
This commit is contained in:
committed by
Andrew Gallant
parent
e169881a36
commit
f1b4b182f2
@ -72,7 +72,7 @@ pub(crate) fn generate() -> String {
|
||||
}
|
||||
|
||||
if let Some(negated) = flag.name_negated() {
|
||||
let dash_name = format!("--{}", negated);
|
||||
let dash_name = format!("--{negated}");
|
||||
flags.push_str("\n ");
|
||||
flags.push_str(
|
||||
&TEMPLATE_FLAG
|
||||
|
@ -307,15 +307,14 @@ impl<W: WriteColor> SearchWorker<W> {
|
||||
io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!(
|
||||
"preprocessor command could not start: '{:?}': {}",
|
||||
cmd, err,
|
||||
"preprocessor command could not start: '{cmd:?}': {err}",
|
||||
),
|
||||
)
|
||||
})?;
|
||||
let result = self.search_reader(path, &mut rdr).map_err(|err| {
|
||||
io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("preprocessor command failed: '{:?}': {}", cmd, err),
|
||||
format!("preprocessor command failed: '{cmd:?}': {err}"),
|
||||
)
|
||||
});
|
||||
let close_result = rdr.close();
|
||||
|
Reference in New Issue
Block a user