Skip to content

Instantly share code, notes, and snippets.

@mbrubeck
Last active April 2, 2018 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrubeck/7b845896a564f4ee4f267d2f3841a47f to your computer and use it in GitHub Desktop.
Save mbrubeck/7b845896a564f4ee4f267d2f3841a47f to your computer and use it in GitHub Desktop.
Rust buffered I/O convenience functions idea
use std::io::{BufReader, BufWriter};
use std::fs::File;
let src = BufReader::new(File::open("input.txt"))?;
let dst = BufWriter::new(File::create("output.txt"))?;
use std::fs::File;
let src = File::open_buffered("input.txt")?;
let dst = File::create_buffered("output.txt")?;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment