Skip to content

Instantly share code, notes, and snippets.

@tailhook
Last active May 29, 2016 23:17
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 tailhook/f80c0ed6935cd907268ac7e123bf90bd to your computer and use it in GitHub Desktop.
Save tailhook/f80c0ed6935cd907268ac7e123bf90bd to your computer and use it in GitHub Desktop.
fn render_docs(source: &Path, dest: &Path) -> Result<(), io::Error> {
for entry_res in try!(read_dir(source)) {
let entry = try!(entry_res);
let file = try!(File::open(&entry.path());
for line_res in file.lines() {
let line = try!(line_res);
// ...
if wrong_syntax_flag {
return Err(io::Error::new(io::ErrorKind::Other,
"Wrong syntax"));
}
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment