1
0
mirror of https://github.com/jht5945/buildj.git synced 2025-12-28 17:50:05 +08:00

ref print_*

This commit is contained in:
2020-05-02 18:46:32 +08:00
parent 72bcca65c7
commit 3c7b4a4424

View File

@@ -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));
});
}
}