From 7d5dfc267b3b1667c97fd4d8a10a680e939f5c6f Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 21 Jul 2019 23:47:48 +0800 Subject: [PATCH] add new_box_error --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 93384e7..6cbbddc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -57,6 +57,10 @@ pub fn get_absolute_path(path: &str) -> Option { fs::canonicalize(path).ok() } +pub fn new_box_error(m: &str) -> Box { + Box::new(Error::new(ErrorKind::Other, m)) +} + pub enum MessageType { INFO, OK, WARN, ERROR, } pub fn print_message_ex(color: Option, h: &str, message: &str) {