use std::fmt;

#[derive(Debug)]
pub enum ErrorLevel {
    Info,
    Warning,
    Error,
}

// Use a hashmap which contains an error level and a string
pub struct ErrorStack(Vec<(ErrorLevel, &'static str)>);

impl fmt::Display for ErrorStack {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.0
            .iter()
            .map(|e| write!(f, "[{:?}] {}\n", e.0, e.1))

            // We must consume the closure
            .collect::<Vec<fmt::Result>>();

        write!(f, "")
    }
}
#[derive(Debug)]
pub enum ErrorLevel {
    Info,
    Warning,
    Error,
}

// Use a hashmap which contains an error level and a string
pub type ErrorStack = Vec<(ErrorLevel, &'static str)>;

--- 
+++ 
@@ -1,3 +1,5 @@
+use std::fmt;
+
 #[derive(Debug)]
 pub enum ErrorLevel {
     Info,
@@ -6,4 +8,17 @@
 }
 
 // Use a hashmap which contains an error level and a string
-pub type ErrorStack = Vec<(ErrorLevel, &'static str)>;
+pub struct ErrorStack(Vec<(ErrorLevel, &'static str)>);
+
+impl fmt::Display for ErrorStack {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.0
+            .iter()
+            .map(|e| write!(f, "[{:?}] {}\n", e.0, e.1))
+
+            // We must consume the closure
+            .collect::<Vec<fmt::Result>>();
+
+        write!(f, "")
+    }
+}
Add display to the error stack and convert the type alias to a struct.
