Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fn render_docs(source: &Path, dest: &Path) -> Result<(), io::Error> {
let dir_list = try!(read_dir(source).context(source));
for entry_res in dir_list {
let entry = try!(entry_res.context(source));
let path = entry.path();
let file = try!(File::open(&path).context(&path));
for line_res in file.lines() {
let line = try!(line_res.context(&path));
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment