chore: Clippy fixes

This commit is contained in:
Ginger
2026-04-30 09:05:34 -04:00
parent 13917bb5c3
commit 3dc4c7d4fc
7 changed files with 15 additions and 27 deletions
+2 -6
View File
@@ -1,9 +1,4 @@
use std::{
collections::{BTreeSet, HashSet},
fmt::Debug,
hash::Hash,
mem::discriminant,
};
use std::{collections::BTreeSet, fmt::Debug, hash::Hash, mem::discriminant};
use regex::Regex;
use ruma::OwnedDeviceId;
@@ -127,6 +122,7 @@ pub enum TokenRequest {
}
impl TokenRequest {
#[must_use]
pub fn client_id(&self) -> &str {
match self {
| Self::AuthorizationCode { client_id, .. }
+4 -4
View File
@@ -1,5 +1,5 @@
use std::{
collections::{BTreeMap, BTreeSet, HashMap},
collections::{BTreeSet, HashMap},
sync::{Arc, Mutex},
time::{Duration, SystemTime},
};
@@ -77,10 +77,10 @@ impl PendingCodeGrant {
const RANDOM_CODE_LENGTH: usize = 32;
#[must_use]
pub fn generate_code() -> String { utils::random_string(Self::RANDOM_CODE_LENGTH) }
pub(crate) fn generate_code() -> String { utils::random_string(Self::RANDOM_CODE_LENGTH) }
#[must_use]
pub fn is_valid_for(&self, client_id: &str) -> bool {
pub(crate) fn is_valid_for(&self, client_id: &str) -> bool {
let now = SystemTime::now();
self.expected_client_id == client_id
@@ -454,7 +454,7 @@ impl Service {
.remove(&session_info.current_refresh_token);
self.db
.userdeviceid_oauthsessioninfo
.del(&(user_id, device_id));
.del((user_id, device_id));
info!(?user_id, ?device_id, "Removed OAuth session");
}
}