Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
Updates for stable rust
Browse files Browse the repository at this point in the history
  • Loading branch information
sk1p committed Aug 15, 2022
1 parent 6bd8c05 commit 7abbdfd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ fn get_msg_type(maybe_value: &Option<serde_json::Value>) -> String {
.as_object()
.expect("all json messages should be objects")
.get("htype");
if let Some(htype_str) = htype && htype_str.is_string() {
htype_str.as_str().expect("htype should be string here").to_string()
if let Some(htype_str) = htype {
if htype_str.is_string() {
htype_str.as_str().expect("htype should be string here").to_string()
} else {
"<unknown>".to_string()
}
} else {
"<unknown>".to_string()
}
Expand Down

0 comments on commit 7abbdfd

Please sign in to comment.