mirror of https://github.com/rust-lang/book
Apply clippy::uninlined_format_args fix
This commit is contained in:
parent
f9d4e058a9
commit
c5211edeec
|
@ -8,7 +8,7 @@ fn main() {
|
|||
|
||||
let mut buffer = String::new();
|
||||
if let Err(e) = io::stdin().read_to_string(&mut buffer) {
|
||||
panic!("{}", e);
|
||||
panic!("{e}");
|
||||
}
|
||||
|
||||
for line in buffer.lines() {
|
||||
|
@ -21,7 +21,7 @@ fn main() {
|
|||
if is_in_code_block {
|
||||
is_in_inline_code = false;
|
||||
is_in_html_tag = false;
|
||||
println!("{}", line);
|
||||
println!("{line}");
|
||||
} else {
|
||||
let modified_line = &mut String::new();
|
||||
let mut previous_char = std::char::REPLACEMENT_CHARACTER;
|
||||
|
@ -72,7 +72,7 @@ fn main() {
|
|||
modified_line.push(char_to_push);
|
||||
previous_char = char_to_push;
|
||||
}
|
||||
println!("{}", modified_line);
|
||||
println!("{modified_line}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ fn main() {
|
|||
.map(|entry| match entry {
|
||||
Ok(entry) => entry,
|
||||
Err(err) => {
|
||||
eprintln!("{:?}", err);
|
||||
eprintln!("{err:?}");
|
||||
std::process::exit(911)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -14,12 +14,12 @@ fn read_md() -> String {
|
|||
let mut buffer = String::new();
|
||||
match io::stdin().read_to_string(&mut buffer) {
|
||||
Ok(_) => buffer,
|
||||
Err(error) => panic!("{}", error),
|
||||
Err(error) => panic!("{error}"),
|
||||
}
|
||||
}
|
||||
|
||||
fn write_md(output: String) {
|
||||
print!("{}", output);
|
||||
print!("{output}");
|
||||
}
|
||||
|
||||
fn parse_references(buffer: String) -> (String, HashMap<String, String>) {
|
||||
|
@ -81,7 +81,7 @@ fn parse_links((buffer, ref_map): (String, HashMap<String, String>)) -> String {
|
|||
}
|
||||
}
|
||||
};
|
||||
format!("{} at *{}*", name, val)
|
||||
format!("{name} at *{val}*")
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -149,7 +149,7 @@ fn copy_cleaned_rust_file(
|
|||
if !ANCHOR_OR_SNIP_COMMENTS.is_match(&line)
|
||||
&& (item_name != "lib.rs" || !EMPTY_MAIN.is_match(&line))
|
||||
{
|
||||
writeln!(&mut to_buf, "{}", line)?;
|
||||
writeln!(&mut to_buf, "{line}")?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@ fn read_md() -> String {
|
|||
let mut buffer = String::new();
|
||||
match io::stdin().read_to_string(&mut buffer) {
|
||||
Ok(_) => buffer,
|
||||
Err(error) => panic!("{}", error),
|
||||
Err(error) => panic!("{error}"),
|
||||
}
|
||||
}
|
||||
|
||||
fn write_md(output: String) {
|
||||
print!("{}", output);
|
||||
print!("{output}");
|
||||
}
|
||||
|
||||
fn remove_hidden_lines(input: &str) -> String {
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::io::Read;
|
|||
fn main() {
|
||||
let mut buffer = String::new();
|
||||
if let Err(e) = io::stdin().read_to_string(&mut buffer) {
|
||||
panic!("{}", e);
|
||||
panic!("{e}");
|
||||
}
|
||||
|
||||
let mut refs = HashSet::new();
|
||||
|
@ -41,5 +41,5 @@ fn main() {
|
|||
caps.get(0).unwrap().as_str().to_string()
|
||||
});
|
||||
|
||||
print!("{}", out);
|
||||
print!("{out}");
|
||||
}
|
||||
|
|
|
@ -12,12 +12,12 @@ fn read_md() -> String {
|
|||
let mut buffer = String::new();
|
||||
match io::stdin().read_to_string(&mut buffer) {
|
||||
Ok(_) => buffer,
|
||||
Err(error) => panic!("{}", error),
|
||||
Err(error) => panic!("{error}"),
|
||||
}
|
||||
}
|
||||
|
||||
fn write_md(output: String) {
|
||||
print!("{}", output);
|
||||
print!("{output}");
|
||||
}
|
||||
|
||||
fn remove_markup(input: String) -> String {
|
||||
|
|
Loading…
Reference in New Issue