Skip to content

Commit

Permalink
Merge pull request #1 from pspdada/main
Browse files Browse the repository at this point in the history
Fix: Use unwrap_or for optional fields in list_all_course function
  • Loading branch information
YinMo19 authored Dec 24, 2024
2 parents 8822435 + fab9f3c commit 4c16819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/req_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ fn list_all_course(all_course: &Vec<Value>) {
"Course 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("")
)
}
Expand Down

0 comments on commit 4c16819

Please sign in to comment.