Last active
April 2, 2018 17:00
-
-
Save mbrubeck/7b845896a564f4ee4f267d2f3841a47f to your computer and use it in GitHub Desktop.
Rust buffered I/O convenience functions idea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"))?; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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