mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-29 00:20:04 +08:00
add new_box_error
This commit is contained in:
@@ -57,6 +57,10 @@ pub fn get_absolute_path(path: &str) -> Option<PathBuf> {
|
|||||||
fs::canonicalize(path).ok()
|
fs::canonicalize(path).ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn new_box_error(m: &str) -> Box<dyn std::error::Error> {
|
||||||
|
Box::new(Error::new(ErrorKind::Other, m))
|
||||||
|
}
|
||||||
|
|
||||||
pub enum MessageType { INFO, OK, WARN, ERROR, }
|
pub enum MessageType { INFO, OK, WARN, ERROR, }
|
||||||
|
|
||||||
pub fn print_message_ex(color: Option<term::color::Color>, h: &str, message: &str) {
|
pub fn print_message_ex(color: Option<term::color::Color>, h: &str, message: &str) {
|
||||||
|
|||||||
Reference in New Issue
Block a user