chore: Fix new clippy nightly lints

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille
2024-06-23 16:01:02 +02:00
committed by Damir Jelić
parent 3f1b9fe524
commit 730c287201
4 changed files with 18 additions and 20 deletions

View File

@@ -308,14 +308,12 @@ impl NotificationSettings {
.await
{
enabled
// Check unstable identifier
} else if let Ok(enabled) = notification_settings
.is_push_rule_enabled(RuleKind::Override, ".org.matrix.msc4028.encrypted_event")
.await
{
enabled
} else {
false
// Check unstable identifier
notification_settings
.is_push_rule_enabled(RuleKind::Override, ".org.matrix.msc4028.encrypted_event")
.await
.unwrap_or(false)
}
}

View File

@@ -654,7 +654,7 @@ impl_state_store!({
.delete(&self.encode_key(keys::STRIPPED_USER_IDS, key))?;
user_ids.put_key_val_owned(
&self.encode_key(keys::USER_IDS, key),
self.encode_key(keys::USER_IDS, key),
&self.serialize_event(&RoomMember::from(&event))?,
)?;
@@ -662,7 +662,7 @@ impl_state_store!({
profile_changes.and_then(|p| p.get(event.state_key()))
{
profiles.put_key_val_owned(
&self.encode_key(keys::PROFILES, key),
self.encode_key(keys::PROFILES, key),
&self.serialize_event(&profile)?,
)?;
}
@@ -721,7 +721,7 @@ impl_state_store!({
let key = (room, state_key);
user_ids.put_key_val_owned(
&self.encode_key(keys::STRIPPED_USER_IDS, key),
self.encode_key(keys::STRIPPED_USER_IDS, key),
&self.serialize_event(&RoomMember::from(&event))?,
)?;
}

View File

@@ -63,7 +63,7 @@ async fn test_echo() {
.and(header("authorization", "Bearer 1234"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$wWgymRfo7ri1uQx0NXO40vLJ" })),
.set_body_json(json!({ "event_id": "$wWgymRfo7ri1uQx0NXO40vLJ" })),
)
.mount(&server)
.await;
@@ -188,7 +188,7 @@ async fn test_retry_failed() {
.and(header("authorization", "Bearer 1234"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$wWgymRfo7ri1uQx0NXO40vLJ" })),
.set_body_json(json!({ "event_id": "$wWgymRfo7ri1uQx0NXO40vLJ" })),
)
.mount(&server)
.await;
@@ -229,7 +229,7 @@ async fn test_dedup_by_event_id_late() {
.and(header("authorization", "Bearer 1234"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": event_id }))
.set_body_json(json!({ "event_id": event_id }))
// Not great to use a timer for this, but it's what wiremock gives us right now.
// Ideally we'd wait on a channel to produce a value or sth. like that.
.set_delay(Duration::from_millis(100)),

View File

@@ -60,7 +60,7 @@ async fn test_message_order() {
.and(body_string_contains("First!"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP" }))
.set_body_json(json!({ "event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP" }))
.set_delay(Duration::from_millis(200)),
)
.mount(&server)
@@ -73,7 +73,7 @@ async fn test_message_order() {
.and(body_string_contains("Second."))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$5E2kLK/Sg342bgBU9ceEIEPYpbFaqJpZ" }))
.set_body_json(json!({ "event_id": "$5E2kLK/Sg342bgBU9ceEIEPYpbFaqJpZ" }))
.set_delay(Duration::from_millis(100)),
)
.mount(&server)
@@ -172,7 +172,7 @@ async fn test_retry_order() {
.and(body_string_contains("First!"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP" }))
.set_body_json(json!({ "event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP" }))
.set_delay(Duration::from_millis(100)),
)
.mount(&server)
@@ -185,7 +185,7 @@ async fn test_retry_order() {
.and(body_string_contains("Second."))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$5E2kLK/Sg342bgBU9ceEIEPYpbFaqJpZ" }))
.set_body_json(json!({ "event_id": "$5E2kLK/Sg342bgBU9ceEIEPYpbFaqJpZ" }))
.set_delay(Duration::from_millis(200)),
)
.mount(&server)
@@ -252,7 +252,7 @@ async fn test_clear_with_echoes() {
.and(path_regex(r"^/_matrix/client/r0/rooms/.*/send/.*"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({ "event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP" }))
.set_body_json(json!({ "event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP" }))
.set_delay(Duration::from_secs(3600)),
)
.mount(&server)
@@ -320,7 +320,7 @@ async fn test_no_duplicate_day_divider() {
.and(body_string_contains("First!"))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({
.set_body_json(json!({
"event_id": "$PyHxV5mYzjetBUT3qZq7V95GOzxb02EP",
}))
.set_delay(Duration::from_millis(200)),
@@ -335,7 +335,7 @@ async fn test_no_duplicate_day_divider() {
.and(body_string_contains("Second."))
.respond_with(
ResponseTemplate::new(200)
.set_body_json(&json!({
.set_body_json(json!({
"event_id": "$5E2kLK/Sg342bgBU9ceEIEPYpbFaqJpZ",
}))
.set_delay(Duration::from_millis(100)),