demo app, long string print

This commit is contained in:
2024-12-21 21:06:02 -06:00
parent cc3d1759a7
commit 738f3da894
3 changed files with 30 additions and 0 deletions

18
demo/build.rs Normal file
View File

@@ -0,0 +1,18 @@
use std::{
env,
error::Error,
fs::File,
io::{BufWriter, Write},
path::Path,
};
fn main() -> Result<(), Box<dyn Error>> {
let out_dir = env::var("OUT_DIR")?;
let dest_path = Path::new(&out_dir).join("long_string.txt");
let mut f = BufWriter::new(File::create(&dest_path)?);
let long_string = "abc".repeat(100);
write!(f, "{}", long_string)?;
Ok(())
}