Use .to_string rather than format macro
This commit is contained in:
parent
0dd1c6ca6b
commit
40741c5b0b
|
@ -124,16 +124,16 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option<String>) ->
|
||||||
Mode::Clippy => "The code is compiling, and 📎 Clippy 📎 is happy!",
|
Mode::Clippy => "The code is compiling, and 📎 Clippy 📎 is happy!",
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("");
|
println!();
|
||||||
println!("🎉 🎉 {} 🎉 🎉", success_msg);
|
println!("🎉 🎉 {} 🎉 🎉", success_msg);
|
||||||
println!("");
|
println!();
|
||||||
|
|
||||||
if let Some(output) = prompt_output {
|
if let Some(output) = prompt_output {
|
||||||
println!("Output:");
|
println!("Output:");
|
||||||
println!("{}", separator());
|
println!("{}", separator());
|
||||||
println!("{}", output);
|
println!("{}", output);
|
||||||
println!("{}", separator());
|
println!("{}", separator());
|
||||||
println!("");
|
println!();
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("You can keep working on this exercise,");
|
println!("You can keep working on this exercise,");
|
||||||
|
@ -141,12 +141,12 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option<String>) ->
|
||||||
"or jump into the next one by removing the {} comment:",
|
"or jump into the next one by removing the {} comment:",
|
||||||
style("`I AM NOT DONE`").bold()
|
style("`I AM NOT DONE`").bold()
|
||||||
);
|
);
|
||||||
println!("");
|
println!();
|
||||||
for context_line in context {
|
for context_line in context {
|
||||||
let formatted_line = if context_line.important {
|
let formatted_line = if context_line.important {
|
||||||
format!("{}", style(context_line.line).bold())
|
format!("{}", style(context_line.line).bold())
|
||||||
} else {
|
} else {
|
||||||
format!("{}", context_line.line)
|
context_line.line.to_string()
|
||||||
};
|
};
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
|
|
Loading…
Reference in a new issue