Created
July 6, 2017 22:03
-
-
Save starrhorne/30b2a09a86209ca0d47a18c7b3d6c539 to your computer and use it in GitHub Desktop.
The `use errors::*` in mymodule causes an unused import warning
This file contains hidden or 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
#![recursion_limit = "1024"] | |
#[macro_use] | |
extern crate error_chain; | |
mod errors { | |
error_chain!{} | |
} | |
use errors::*; | |
mod mymodule; | |
quick_main!(mymodule::run); |
This file contains hidden or 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
// 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