diff --git a/examples/req_auth.rs b/examples/req_auth.rs index cc7ca6c..455ccf9 100644 --- a/examples/req_auth.rs +++ b/examples/req_auth.rs @@ -167,7 +167,7 @@ async fn choose_course(all_course: &Vec, client: Client) -> Result<(), Bo "\n\nCourse id: {}, Course name: {}, Course teacher: {} {}", course["id"].as_str().unwrap().green().bold(), course["kcmc"].as_str().unwrap().purple().bold(), - course["dgjsmc"].as_str().unwrap().blue().bold(), + course["dgjsmc"].as_str().unwrap_or("").blue().bold(), course["tyxmmc"].as_str().unwrap_or("").blue().bold(), ); diff --git a/src/main.rs b/src/main.rs index 7579ef0..46d5a84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,7 @@ async fn choose_course(all_course: &Vec, cookie: &str) -> Result<(), Box< "\n\nCourse id: {}, Course name: {}, Course teacher: {} {}", course["id"].as_str().unwrap().green().bold(), course["kcmc"].as_str().unwrap().purple().bold(), - course["dgjsmc"].as_str().unwrap().blue().bold(), + course["dgjsmc"].as_str().unwrap_or("").blue().bold(), course["tyxmmc"].as_str().unwrap_or("").blue().bold(), );