Skip to content

Commit

Permalink
Pretty print errors using Display instead of Debug
Browse files Browse the repository at this point in the history
Until now, error reporting relied on the default behaviour of Rust’s
`Termination` trait which would print a debug representation in case of
an error.
  • Loading branch information
cruessler committed Aug 23, 2018
1 parent 435cc3b commit b74e4f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ fn fallback(path: &Path, flags: &Flags) -> Result<Option<Node>, Error> {
node.map(|node| Some(node))
}

fn main() -> Result<(), Error> {
fn run() -> Result<(), Error> {
let matches = App::new("git-tree")
.version(env!("CARGO_PKG_VERSION"))
.author("Christoph Rüßler <[email protected]>")
Expand Down Expand Up @@ -429,3 +429,9 @@ fn main() -> Result<(), Error> {

Ok(())
}

fn main() {
if let Err(err) = run() {
println!("{}", err);
}
}

0 comments on commit b74e4f5

Please sign in to comment.