Skip to content

Commit b26770f

Browse files
committed
Use Error::source() and drop Error::description()
Author: Harald Hoyer <[email protected]> Author: Paul Colomiets <[email protected]> This is revised PR #45
1 parent 3cbd3cc commit b26770f

File tree

2 files changed

+172
-99
lines changed

2 files changed

+172
-99
lines changed

examples/context.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
#[macro_use(quick_error)] extern crate quick_error;
2-
3-
use std::io::{self, stderr, Read, Write};
4-
use std::fs::File;
1+
use quick_error::{quick_error, ResultExt};
52
use std::env;
3+
use std::fs::File;
4+
use std::io::{self, stderr, Read, Write};
65
use std::num::ParseIntError;
76
use std::path::{Path, PathBuf};
87

9-
use quick_error::ResultExt;
10-
118
quick_error! {
129
#[derive(Debug)]
1310
pub enum Error {
14-
NoFileName {
15-
description("no file name specified")
16-
}
11+
NoFileName {}
1712
Io(err: io::Error, path: PathBuf) {
1813
display("could not read file {:?}: {}", path, err)
1914
context(path: &'a Path, err: io::Error)

0 commit comments

Comments
 (0)