Skip to content

Commit 4c4ea0e

Browse files
authored
Merge pull request #410 from ogoffart/master
Implement Display for Error
2 parents 469c2b6 + f676c2c commit 4c4ea0e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ extern crate rayon;
6464
use std::collections::HashMap;
6565
use std::env;
6666
use std::ffi::{OsStr, OsString};
67+
use std::fmt::{self, Display};
6768
use std::fs;
6869
use std::io::{self, BufRead, BufReader, Read, Write};
6970
use std::path::{Path, PathBuf};
@@ -162,6 +163,12 @@ impl From<io::Error> for Error {
162163
}
163164
}
164165

166+
impl Display for Error {
167+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
168+
write!(f, "{:?}: {}", self.kind, self.message)
169+
}
170+
}
171+
165172
/// Configuration used to represent an invocation of a C compiler.
166173
///
167174
/// This can be used to figure out what compiler is in use, what the arguments

0 commit comments

Comments
 (0)