Skip to content

Instantly share code, notes, and snippets.

@starrhorne
Created July 6, 2017 22:03
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 starrhorne/30b2a09a86209ca0d47a18c7b3d6c539 to your computer and use it in GitHub Desktop.
Save starrhorne/30b2a09a86209ca0d47a18c7b3d6c539 to your computer and use it in GitHub Desktop.
The `use errors::*` in mymodule causes an unused import warning
#![recursion_limit = "1024"]
#[macro_use]
extern crate error_chain;
mod errors {
error_chain!{}
}
use errors::*;
mod mymodule;
quick_main!(mymodule::run);
// Is this the correct way to pull error-chain into the module?
// It gives an unused import warning.
use errors::*;
pub fn run() -> Result<()> {
// This operation will fail
use std::fs::File;
File::open("tretrete")
.chain_err(|| "unable to open tretrete file")?;
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment