1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Fix Clippy warnings about enum size variants difference

This commit is contained in:
Quentin Gliech
2023-09-04 16:35:44 +02:00
parent 15ade8e1c8
commit 0896292006
2 changed files with 7 additions and 7 deletions

View File

@ -39,18 +39,18 @@ impl Viewer {
/// Represents the current viewer's session
#[derive(Union)]
pub enum ViewerSession {
BrowserSession(BrowserSession),
OAuth2Session(OAuth2Session),
BrowserSession(Box<BrowserSession>),
OAuth2Session(Box<OAuth2Session>),
Anonymous(Anonymous),
}
impl ViewerSession {
pub fn browser_session(session: mas_data_model::BrowserSession) -> Self {
Self::BrowserSession(BrowserSession(session))
Self::BrowserSession(Box::new(BrowserSession(session)))
}
pub fn oauth2_session(session: mas_data_model::Session) -> Self {
Self::OAuth2Session(OAuth2Session(session))
Self::OAuth2Session(Box::new(OAuth2Session(session)))
}
pub fn anonymous() -> Self {

View File

@ -35,7 +35,7 @@ pub struct EndBrowserSessionInput {
/// The payload of the `endBrowserSession` mutation.
pub enum EndBrowserSessionPayload {
NotFound,
Ended(mas_data_model::BrowserSession),
Ended(Box<mas_data_model::BrowserSession>),
}
/// The status of the `endBrowserSession` mutation.
@ -61,7 +61,7 @@ impl EndBrowserSessionPayload {
/// Returns the ended session.
async fn browser_session(&self) -> Option<BrowserSession> {
match self {
Self::Ended(session) => Some(BrowserSession(session.clone())),
Self::Ended(session) => Some(BrowserSession(*session.clone())),
Self::NotFound => None,
}
}
@ -96,6 +96,6 @@ impl BrowserSessionMutations {
repo.save().await?;
Ok(EndBrowserSessionPayload::Ended(session))
Ok(EndBrowserSessionPayload::Ended(Box::new(session)))
}
}