Skip to content

Commit b74e4f5

Browse files
committed
Pretty print errors using Display instead of Debug
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.
1 parent 435cc3b commit b74e4f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ fn fallback(path: &Path, flags: &Flags) -> Result<Option<Node>, Error> {
372372
node.map(|node| Some(node))
373373
}
374374

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

430430
Ok(())
431431
}
432+
433+
fn main() {
434+
if let Err(err) = run() {
435+
println!("{}", err);
436+
}
437+
}

0 commit comments

Comments
 (0)