We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
format-collect
build.rs
1 parent 3ccb14e commit acfe95cCopy full SHA for acfe95c
spdlog/build.rs
@@ -1,6 +1,7 @@
1
use std::{
2
env,
3
error::Error,
4
+ fmt::Write,
5
fs,
6
path::{Path, PathBuf},
7
};
@@ -38,10 +39,13 @@ fn generate_code_test_utils() -> Result<(), Box<dyn Error>> {
38
39
40
fs::write(
41
out_dir.join("common_for_doc_test.rs"),
- format!("mod test_utils {{\n{}\n}}", input)
42
- .lines()
43
- .map(|line| format!("# {}\n", line))
44
- .collect::<String>(),
+ format!("mod test_utils {{\n{}\n}}", input).lines().fold(
+ String::new(),
+ |mut contents, line| {
45
+ writeln!(&mut contents, "# {}", line).unwrap();
46
+ contents
47
+ },
48
+ ),
49
)?;
50
51
out_dir.join("common_for_integration_test.rs"),
0 commit comments