1
0
mirror of https://github.com/jht5945/buildj.git synced 2025-12-28 09:40:04 +08:00

update match -> if

This commit is contained in:
2019-08-24 00:58:54 +08:00
parent 009b03b489
commit 0529180af0

View File

@@ -193,18 +193,17 @@ pub fn set_tool_package_secret(secret: &str) -> XResult<()> {
}
pub fn get_tool_package_detail(name: &str, version: &str) -> XResult<String> {
let secret = match *NOAUTH {
true => {
print_message(MessageType::WARN, "Running in no auth mode!");
None
},
false => match get_tool_package_secret() {
let secret: Option<String> = if *NOAUTH {
print_message(MessageType::WARN, "Running in no auth mode!");
None
} else {
match get_tool_package_secret() {
Err(err) => {
print_message(MessageType::WARN, &format!("Get package detail secret failed: {}, from file: ~/{}", err, STANDARD_CONFIG_JSON));
None
},
Ok(r) => Some(r),
},
}
};
let mut url = String::new();