chore: Fix new clippy warnings
This commit is contained in:
parent
6087f7efbb
commit
04654f8833
@ -188,13 +188,13 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn serialize_string() {
|
||||
assert_eq!(to_json_value(&Action::Notify).unwrap(), json!("notify"));
|
||||
assert_eq!(to_json_value(Action::Notify).unwrap(), json!("notify"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn serialize_tweak_sound() {
|
||||
assert_eq!(
|
||||
to_json_value(&Action::SetTweak(Tweak::Sound("default".into()))).unwrap(),
|
||||
to_json_value(Action::SetTweak(Tweak::Sound("default".into()))).unwrap(),
|
||||
json!({ "set_tweak": "sound", "value": "default" })
|
||||
);
|
||||
}
|
||||
@ -202,12 +202,12 @@ mod tests {
|
||||
#[test]
|
||||
fn serialize_tweak_highlight() {
|
||||
assert_eq!(
|
||||
to_json_value(&Action::SetTweak(Tweak::Highlight(true))).unwrap(),
|
||||
to_json_value(Action::SetTweak(Tweak::Highlight(true))).unwrap(),
|
||||
json!({ "set_tweak": "highlight" })
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
to_json_value(&Action::SetTweak(Tweak::Highlight(false))).unwrap(),
|
||||
to_json_value(Action::SetTweak(Tweak::Highlight(false))).unwrap(),
|
||||
json!({ "set_tweak": "highlight", "value": false })
|
||||
);
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ impl StrExt for str {
|
||||
return false;
|
||||
}
|
||||
|
||||
let has_wildcards = pattern.contains(|c| matches!(c, '?' | '*'));
|
||||
let has_wildcards = pattern.contains(['?', '*']);
|
||||
|
||||
if has_wildcards {
|
||||
let mut chunks: Vec<String> = vec![];
|
||||
|
@ -36,13 +36,13 @@ fn serialize_redacted_message_event_content() {
|
||||
|
||||
#[test]
|
||||
fn serialize_empty_redacted_aliases_event_content() {
|
||||
assert_eq!(to_json_value(&RedactedRoomAliasesEventContent::default()).unwrap(), json!({}));
|
||||
assert_eq!(to_json_value(RedactedRoomAliasesEventContent::default()).unwrap(), json!({}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn redacted_aliases_event_serialize_with_content() {
|
||||
let expected = json!({ "aliases": [] });
|
||||
let actual = to_json_value(&RedactedRoomAliasesEventContent::new_v1(vec![])).unwrap();
|
||||
let actual = to_json_value(RedactedRoomAliasesEventContent::new_v1(vec![])).unwrap();
|
||||
assert_eq!(actual, expected);
|
||||
}
|
||||
|
||||
|
@ -342,11 +342,7 @@ pub mod v1 {
|
||||
// If a highlight tweak is given with no value, its value is defined to be
|
||||
// true.
|
||||
"highlight" => {
|
||||
let highlight = if let Ok(highlight) = access.next_value() {
|
||||
highlight
|
||||
} else {
|
||||
true
|
||||
};
|
||||
let highlight = access.next_value().unwrap_or(true);
|
||||
|
||||
tweaks.push(Tweak::Highlight(highlight));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user