mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-28 17:50:05 +08:00
ref print_*
This commit is contained in:
@@ -11,8 +11,7 @@ use rust_util::{
|
||||
XResult,
|
||||
new_box_ioerror,
|
||||
util_msg::{
|
||||
print_message,
|
||||
MessageType,
|
||||
print_error,
|
||||
},
|
||||
util_io::*,
|
||||
};
|
||||
@@ -54,7 +53,7 @@ pub fn verify_file_integrity(integrity: &str, file_name: &str) -> XResult<bool>
|
||||
};
|
||||
let integrity_verify_result = digest_hex == calc_digest_hex.as_str();
|
||||
if ! integrity_verify_result {
|
||||
print_message(MessageType::ERROR, &format!("Verify integrity failed, expected: {}, actual: {}", digest_hex, calc_digest_hex));
|
||||
print_error(&format!("Verify integrity failed, expected: {}, actual: {}", digest_hex, calc_digest_hex));
|
||||
}
|
||||
Ok(integrity_verify_result)
|
||||
},
|
||||
@@ -134,7 +133,7 @@ pub fn init_home_dir(home_sub_dir: &str) {
|
||||
pub fn init_dir(dir: &str) {
|
||||
if ! Path::new(dir).exists() {
|
||||
fs::create_dir_all(dir).unwrap_or_else(|err| {
|
||||
print_message(MessageType::ERROR, &format!("Init dir {} failed: {}", dir, err));
|
||||
print_error(&format!("Init dir {} failed: {}", dir, err));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user