clippy: fix warning by implementing Eq

This commit is contained in:
Valentin Tolmer 2022-09-27 06:48:39 +02:00 committed by nitnelave
parent 516893f1f7
commit 6c21f2ef4b
13 changed files with 19 additions and 19 deletions

View File

@ -36,7 +36,7 @@ impl OpaqueData {
} }
/// The fields of the form, with the constraints. /// The fields of the form, with the constraints.
#[derive(Model, Validate, PartialEq, Clone, Default)] #[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
pub struct FormModel { pub struct FormModel {
#[validate(custom( #[validate(custom(
function = "empty_or_long", function = "empty_or_long",
@ -64,7 +64,7 @@ pub struct ChangePasswordForm {
route_dispatcher: RouteAgentDispatcher, route_dispatcher: RouteAgentDispatcher,
} }
#[derive(Clone, PartialEq, Properties)] #[derive(Clone, PartialEq, Eq, Properties)]
pub struct Props { pub struct Props {
pub username: String, pub username: String,
pub is_admin: bool, pub is_admin: bool,

View File

@ -28,7 +28,7 @@ pub struct CreateGroupForm {
form: yew_form::Form<CreateGroupModel>, form: yew_form::Form<CreateGroupModel>,
} }
#[derive(Model, Validate, PartialEq, Clone, Default)] #[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
pub struct CreateGroupModel { pub struct CreateGroupModel {
#[validate(length(min = 1, message = "Groupname is required"))] #[validate(length(min = 1, message = "Groupname is required"))]
groupname: String, groupname: String,

View File

@ -32,7 +32,7 @@ pub struct CreateUserForm {
form: yew_form::Form<CreateUserModel>, form: yew_form::Form<CreateUserModel>,
} }
#[derive(Model, Validate, PartialEq, Clone, Default)] #[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
pub struct CreateUserModel { pub struct CreateUserModel {
#[validate(length(min = 1, message = "Username is required"))] #[validate(length(min = 1, message = "Username is required"))]
username: String, username: String,

View File

@ -40,7 +40,7 @@ pub enum Msg {
OnUserRemovedFromGroup((String, i64)), OnUserRemovedFromGroup((String, i64)),
} }
#[derive(yew::Properties, Clone, PartialEq)] #[derive(yew::Properties, Clone, PartialEq, Eq)]
pub struct Props { pub struct Props {
pub group_id: i64, pub group_id: i64,
} }

View File

@ -13,7 +13,7 @@ use yew::prelude::*;
#[graphql( #[graphql(
schema_path = "../schema.graphql", schema_path = "../schema.graphql",
query_path = "queries/get_group_list.graphql", query_path = "queries/get_group_list.graphql",
response_derives = "Debug,Clone,PartialEq", response_derives = "Debug,Clone,PartialEq,Eq",
custom_scalars_module = "crate::infra::graphql" custom_scalars_module = "crate::infra::graphql"
)] )]
pub struct GetGroupList; pub struct GetGroupList;

View File

@ -19,7 +19,7 @@ pub struct LoginForm {
} }
/// The fields of the form, with the constraints. /// The fields of the form, with the constraints.
#[derive(Model, Validate, PartialEq, Clone, Default)] #[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
pub struct FormModel { pub struct FormModel {
#[validate(length(min = 1, message = "Missing username"))] #[validate(length(min = 1, message = "Missing username"))]
username: String, username: String,

View File

@ -18,7 +18,7 @@ pub struct ResetPasswordStep1Form {
} }
/// The fields of the form, with the constraints. /// The fields of the form, with the constraints.
#[derive(Model, Validate, PartialEq, Clone, Default)] #[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
pub struct FormModel { pub struct FormModel {
#[validate(length(min = 1, message = "Missing username"))] #[validate(length(min = 1, message = "Missing username"))]
username: String, username: String,

View File

@ -20,7 +20,7 @@ use yew_router::{
}; };
/// The fields of the form, with the constraints. /// The fields of the form, with the constraints.
#[derive(Model, Validate, PartialEq, Clone, Default)] #[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
pub struct FormModel { pub struct FormModel {
#[validate(length(min = 8, message = "Invalid password. Min length: 8"))] #[validate(length(min = 8, message = "Invalid password. Min length: 8"))]
password: String, password: String,
@ -36,7 +36,7 @@ pub struct ResetPasswordStep2Form {
route_dispatcher: RouteAgentDispatcher, route_dispatcher: RouteAgentDispatcher,
} }
#[derive(Clone, PartialEq, Properties)] #[derive(Clone, PartialEq, Eq, Properties)]
pub struct Props { pub struct Props {
pub token: String, pub token: String,
} }

View File

@ -81,7 +81,7 @@ pub struct SelectOption {
props: SelectOptionProps, props: SelectOptionProps,
} }
#[derive(yew::Properties, Clone, PartialEq, Debug)] #[derive(yew::Properties, Clone, PartialEq, Eq, Debug)]
pub struct SelectOptionProps { pub struct SelectOptionProps {
pub value: String, pub value: String,
pub text: String, pub text: String,

View File

@ -40,7 +40,7 @@ pub enum Msg {
OnUserRemovedFromGroup((String, i64)), OnUserRemovedFromGroup((String, i64)),
} }
#[derive(yew::Properties, Clone, PartialEq)] #[derive(yew::Properties, Clone, PartialEq, Eq)]
pub struct Props { pub struct Props {
pub username: String, pub username: String,
pub is_admin: bool, pub is_admin: bool,

View File

@ -11,7 +11,7 @@ use wasm_bindgen::JsCast;
use yew::{prelude::*, services::ConsoleService}; use yew::{prelude::*, services::ConsoleService};
use yew_form_derive::Model; use yew_form_derive::Model;
#[derive(PartialEq, Clone, Default)] #[derive(PartialEq, Eq, Clone, Default)]
struct JsFile { struct JsFile {
file: Option<web_sys::File>, file: Option<web_sys::File>,
contents: Option<Vec<u8>>, contents: Option<Vec<u8>>,
@ -39,7 +39,7 @@ impl FromStr for JsFile {
} }
/// The fields of the form, with the editable details and the constraints. /// The fields of the form, with the editable details and the constraints.
#[derive(Model, Validate, PartialEq, Clone)] #[derive(Model, Validate, PartialEq, Eq, Clone)]
pub struct UserModel { pub struct UserModel {
#[validate(email)] #[validate(email)]
email: String, email: String,
@ -55,7 +55,7 @@ pub struct UserModel {
schema_path = "../schema.graphql", schema_path = "../schema.graphql",
query_path = "queries/update_user.graphql", query_path = "queries/update_user.graphql",
response_derives = "Debug", response_derives = "Debug",
variables_derives = "Clone,PartialEq", variables_derives = "Clone,PartialEq,Eq",
custom_scalars_module = "crate::infra::graphql" custom_scalars_module = "crate::infra::graphql"
)] )]
pub struct UpdateUser; pub struct UpdateUser;
@ -80,7 +80,7 @@ pub enum Msg {
UserUpdated(Result<update_user::ResponseData>), UserUpdated(Result<update_user::ResponseData>),
} }
#[derive(yew::Properties, Clone, PartialEq)] #[derive(yew::Properties, Clone, PartialEq, Eq)]
pub struct Props { pub struct Props {
/// The current user details. /// The current user details.
pub user: User, pub user: User,

View File

@ -265,7 +265,7 @@ pub struct GroupDetails {
pub uuid: Uuid, pub uuid: Uuid,
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct UserAndGroups { pub struct UserAndGroups {
pub user: User, pub user: User,
pub groups: Option<Vec<GroupDetails>>, pub groups: Option<Vec<GroupDetails>>,

View File

@ -562,7 +562,7 @@ where
} }
} }
#[derive(Clone, Copy, PartialEq, Debug)] #[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Permission { pub enum Permission {
Admin, Admin,
PasswordManager, PasswordManager,
@ -570,7 +570,7 @@ pub enum Permission {
Regular, Regular,
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct ValidationResults { pub struct ValidationResults {
pub user: UserId, pub user: UserId,
pub permission: Permission, pub permission: Permission,