From a3ce96d4bff5bc20c3c99e246b3467b1de37485d Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 6 Mar 2024 13:27:03 +0100 Subject: [PATCH] clippy --- src/model/user.rs | 30 ++++++++++++++++++------------ src/tera/admin/mod.rs | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/model/user.rs b/src/model/user.rs index f1990b6..5a8c3d8 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -108,6 +108,12 @@ pub struct Fee { pub paid: bool, } +impl Default for Fee { + fn default() -> Self { + Self::new() + } +} + impl Fee { pub fn new() -> Self { Self { @@ -790,18 +796,18 @@ impl<'r> FromRequest<'r> for AllowedForPlannedTripsUser { } } -impl Into for AllowedForPlannedTripsUser { - fn into(self) -> User { - self.0 +impl From for User { + fn from(val: AllowedForPlannedTripsUser) -> Self { + val.0 } } #[derive(Debug, Serialize, Deserialize)] pub struct DonauLinzUser(pub(crate) User); -impl Into for DonauLinzUser { - fn into(self) -> User { - self.0 +impl From for User { + fn from(val: DonauLinzUser) -> Self { + val.0 } } @@ -839,9 +845,9 @@ impl<'r> FromRequest<'r> for DonauLinzUser { #[derive(Debug, Serialize, Deserialize)] pub struct VorstandUser(pub(crate) User); -impl Into for VorstandUser { - fn into(self) -> User { - self.0 +impl From for User { + fn from(val: VorstandUser) -> Self { + val.0 } } @@ -876,9 +882,9 @@ impl<'r> FromRequest<'r> for VorstandUser { #[derive(Debug, Serialize, Deserialize)] pub struct PlannedEventUser(pub(crate) User); -impl Into for PlannedEventUser { - fn into(self) -> User { - self.0 +impl From for User { + fn from(val: PlannedEventUser) -> Self { + val.0 } } diff --git a/src/tera/admin/mod.rs b/src/tera/admin/mod.rs index 27b24b8..04b23cd 100644 --- a/src/tera/admin/mod.rs +++ b/src/tera/admin/mod.rs @@ -68,7 +68,7 @@ async fn list(db: &State, _admin: AdminUser, list_form: Form Vec { -- 2.45.2