Skip to content

Commit

Permalink
refactor: remove redundant derefs
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Oct 10, 2023
1 parent 04a5178 commit d6c108c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,24 +346,24 @@ impl NotificationResponse {

let activation_type = dictionary
.object_for(NSString::from_str("activationType").deref())
.map(|str| str.deref().as_str().to_owned());
.map(|str| str.as_str().to_owned());

match activation_type.as_deref() {
Some("actionClicked") => NotificationResponse::ActionButton(
match dictionary.object_for(NSString::from_str("activationValue").deref()) {
Some(str) => str.deref().as_str().to_owned(),
Some(str) => str.as_str().to_owned(),
None => String::from(""),
},
),
Some("closeClicked") => NotificationResponse::CloseButton(
match dictionary.object_for(NSString::from_str("activationValue").deref()) {
Some(str) => str.deref().as_str().to_owned(),
Some(str) => str.as_str().to_owned(),
None => String::from(""),
},
),
Some("replied") => NotificationResponse::Reply(
match dictionary.object_for(NSString::from_str("activationValue").deref()) {
Some(str) => str.deref().as_str().to_owned(),
Some(str) => str.as_str().to_owned(),
None => String::from(""),
},
),
Expand Down

0 comments on commit d6c108c

Please sign in to comment.