mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Auto merge of #9620 - danieleades:refactor/use-writeln, r=Eh2406
use 'writeln' instead of appending newline character
This commit is contained in:
commit
58be9793af
@ -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