mirror of
https://github.com/jht5945/buildj.git
synced 2025-12-28 01:31:35 +08:00
match -> unwrap_or_else
This commit is contained in:
@@ -19,4 +19,4 @@ pub fn download_url(url: &str, dest: &mut File) -> XResult<()> {
|
||||
|
||||
pub fn get_url(url: &str) -> XResult<String> {
|
||||
Ok(reqwest::get(url)?.text()?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,10 +127,9 @@ pub fn extract_jdk_and_wait(file_name: &str) {
|
||||
Err(_) => return,
|
||||
Ok(o) => o,
|
||||
};
|
||||
match local_util::extract_package_and_wait(&local_java_home_base_dir, file_name) {
|
||||
Err(err) => print_message(MessageType::ERROR, &format!("Extract file: {}, failed: {}", file_name, err)),
|
||||
Ok(_) => (),
|
||||
};
|
||||
local_util::extract_package_and_wait(&local_java_home_base_dir, file_name).unwrap_or_else(|err| {
|
||||
print_message(MessageType::ERROR, &format!("Extract file: {}, failed: {}", file_name, err));
|
||||
});
|
||||
}
|
||||
|
||||
pub fn get_env() -> HashMap<String, String> {
|
||||
|
||||
Reference in New Issue
Block a user