Skip to content

Instantly share code, notes, and snippets.

@tailhook
Last active May 29, 2016 23:21
Show Gist options
  • Save tailhook/f69cba3b0757644b284282a488d2e898 to your computer and use it in GitHub Desktop.
Save tailhook/f69cba3b0757644b284282a488d2e898 to your computer and use it in GitHub Desktop.
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