chore: Fix clippy warnings

This commit is contained in:
Jade Ellis
2026-05-19 20:26:04 +01:00
parent cb3ebcf24e
commit 3987331c3b
2 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -219,14 +219,14 @@ async fn is_event_report_valid(
fn build_report(report: Report) -> RoomMessageEventContent {
let mut text =
format!("@room New {} report received from {}:\n\n", report.report_type, report.sender);
if report.user_id.is_some() {
let _ = writeln!(text, "- Reported User ID: `{}`", report.user_id.unwrap());
if let Some(user_id) = report.user_id {
let _ = writeln!(text, "- Reported User ID: `{user_id}`");
}
if report.room_id.is_some() {
let _ = writeln!(text, "- Reported Room ID: `{}`", report.room_id.unwrap());
if let Some(room_id) = report.room_id {
let _ = writeln!(text, "- Reported Room ID: `{room_id}`");
}
if report.event_id.is_some() {
let _ = writeln!(text, "- Reported Event ID: `{}`", report.event_id.unwrap());
if let Some(event_id) = report.event_id {
let _ = writeln!(text, "- Reported Event ID: `{event_id}`");
}
let _ = writeln!(text, "- Report Reason: {}", report.reason);
+2 -2
View File
@@ -284,11 +284,11 @@ fn is_within_bounds() {
use utils::time::{TimeDirection, is_within_bounds};
let now = SystemTime::now();
let yesterday = now - Duration::from_secs(86400);
let yesterday = now - Duration::from_hours(24);
assert!(is_within_bounds(yesterday, now, TimeDirection::Before));
assert!(!is_within_bounds(yesterday, now, TimeDirection::After));
let tomorrow = now + Duration::from_secs(86400);
let tomorrow = now + Duration::from_hours(24);
assert!(is_within_bounds(tomorrow, now, TimeDirection::After));
assert!(!is_within_bounds(tomorrow, now, TimeDirection::Before));