Skip to content

Commit 58be979

Browse files
committed
Auto merge of #9620 - danieleades:refactor/use-writeln, r=Eh2406
use 'writeln' instead of appending newline character
2 parents 9233aa0 + 706c824 commit 58be979

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/testsuite/weak_dep_features.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use std::fmt::Write;
1010
fn require(enabled_features: &[&str], disabled_features: &[&str]) -> String {
1111
let mut s = String::new();
1212
for feature in enabled_features {
13-
write!(s, "#[cfg(not(feature=\"{feature}\"))] compile_error!(\"expected feature {feature} to be enabled\");\n",
13+
writeln!(s, "#[cfg(not(feature=\"{feature}\"))] compile_error!(\"expected feature {feature} to be enabled\");",
1414
feature=feature).unwrap();
1515
}
1616
for feature in disabled_features {
17-
write!(s, "#[cfg(feature=\"{feature}\")] compile_error!(\"did not expect feature {feature} to be enabled\");\n",
17+
writeln!(s, "#[cfg(feature=\"{feature}\")] compile_error!(\"did not expect feature {feature} to be enabled\");",
1818
feature=feature).unwrap();
1919
}
2020
s

0 commit comments

Comments
 (0)