From 75d063d87f67c161ad5fcbf9eb5955dfed0d1611 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 23 Aug 2020 22:46:28 +0100 Subject: [PATCH] for revert - error_display - can just use {:?} --- src/lib.rs | 1 + src/utils.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f1d151b3..dc7e63c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ #![feature(proc_macro_hygiene, decl_macro)] #![feature(slice_strip)] +#![feature(error_iter)] #![allow(clippy::redundant_closure_call)] diff --git a/src/utils.rs b/src/utils.rs index 55117cb8..878d5d0a 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -6,3 +6,9 @@ pub trait OrdExt : Ord + Sized { } impl OrdExt for T where T : Ord + Sized { } + +pub fn error_display>(err: &E) { + for (e,i) in err.as_ref().chain().zip(0..) { + eprintln!("error {:2}: {}", i,e); + } +} -- 2.30.2