You've already forked authentication-service
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:
@ -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 {
|
||||
|
@ -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)))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user