mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
use 'writeln' instead of appending newline character
This commit is contained in:
parent
9233aa06c8
commit
706c8242e3
@ -10,11 +10,11 @@ use std::fmt::Write;
|
||||
fn require(enabled_features: &[&str], disabled_features: &[&str]) -> String {
|
||||
let mut s = String::new();
|
||||
for feature in enabled_features {
|
||||
write!(s, "#[cfg(not(feature=\"{feature}\"))] compile_error!(\"expected feature {feature} to be enabled\");\n",
|
||||
writeln!(s, "#[cfg(not(feature=\"{feature}\"))] compile_error!(\"expected feature {feature} to be enabled\");",
|
||||
feature=feature).unwrap();
|
||||
}
|
||||
for feature in disabled_features {
|
||||
write!(s, "#[cfg(feature=\"{feature}\")] compile_error!(\"did not expect feature {feature} to be enabled\");\n",
|
||||
writeln!(s, "#[cfg(feature=\"{feature}\")] compile_error!(\"did not expect feature {feature} to be enabled\");",
|
||||
feature=feature).unwrap();
|
||||
}
|
||||
s
|
||||
|
Loading…
x
Reference in New Issue
Block a user