Skip to content

Instantly share code, notes, and snippets.

@jayhuang75
Created April 28, 2022 21:05
Show Gist options
  • Save jayhuang75/9a6ba4c99b71a3717d60695ec6f5c59d to your computer and use it in GitHub Desktop.
Save jayhuang75/9a6ba4c99b71a3717d60695ec6f5c59d to your computer and use it in GitHub Desktop.
rust-velocity-limit-bufwriter
let f = File::create(path).expect("Unable to create file");
+let mut buf = BufWriter::new(f);
for line in &self.output{
let serialized = serde_json::to_string(&line).unwrap();
writeln!(&mut buf, "{}", serialized).unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment