mirror of
				https://github.com/nitnelave/lldap.git
				synced 2023-04-12 14:25:13 +00:00 
			
		
		
		
	clippy: fix warning by implementing Eq
This commit is contained in:
		
							parent
							
								
									516893f1f7
								
							
						
					
					
						commit
						6565552844
					
				@ -36,7 +36,7 @@ impl OpaqueData {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// The fields of the form, with the constraints.
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct FormModel {
 | 
			
		||||
    #[validate(custom(
 | 
			
		||||
        function = "empty_or_long",
 | 
			
		||||
@ -64,7 +64,7 @@ pub struct ChangePasswordForm {
 | 
			
		||||
    route_dispatcher: RouteAgentDispatcher,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, PartialEq, Properties)]
 | 
			
		||||
#[derive(Clone, PartialEq, Eq, Properties)]
 | 
			
		||||
pub struct Props {
 | 
			
		||||
    pub username: String,
 | 
			
		||||
    pub is_admin: bool,
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@ pub struct CreateGroupForm {
 | 
			
		||||
    form: yew_form::Form<CreateGroupModel>,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct CreateGroupModel {
 | 
			
		||||
    #[validate(length(min = 1, message = "Groupname is required"))]
 | 
			
		||||
    groupname: String,
 | 
			
		||||
 | 
			
		||||
@ -32,7 +32,7 @@ pub struct CreateUserForm {
 | 
			
		||||
    form: yew_form::Form<CreateUserModel>,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct CreateUserModel {
 | 
			
		||||
    #[validate(length(min = 1, message = "Username is required"))]
 | 
			
		||||
    username: String,
 | 
			
		||||
 | 
			
		||||
@ -40,7 +40,7 @@ pub enum Msg {
 | 
			
		||||
    OnUserRemovedFromGroup((String, i64)),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq)]
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq, Eq)]
 | 
			
		||||
pub struct Props {
 | 
			
		||||
    pub group_id: i64,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,7 @@ use yew::prelude::*;
 | 
			
		||||
#[graphql(
 | 
			
		||||
    schema_path = "../schema.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"
 | 
			
		||||
)]
 | 
			
		||||
pub struct GetGroupList;
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ pub struct LoginForm {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// The fields of the form, with the constraints.
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct FormModel {
 | 
			
		||||
    #[validate(length(min = 1, message = "Missing username"))]
 | 
			
		||||
    username: String,
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,7 @@ pub struct ResetPasswordStep1Form {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// The fields of the form, with the constraints.
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct FormModel {
 | 
			
		||||
    #[validate(length(min = 1, message = "Missing username"))]
 | 
			
		||||
    username: String,
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,7 @@ use yew_router::{
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/// The fields of the form, with the constraints.
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(Model, Validate, PartialEq, Eq, Clone, Default)]
 | 
			
		||||
pub struct FormModel {
 | 
			
		||||
    #[validate(length(min = 8, message = "Invalid password. Min length: 8"))]
 | 
			
		||||
    password: String,
 | 
			
		||||
@ -36,7 +36,7 @@ pub struct ResetPasswordStep2Form {
 | 
			
		||||
    route_dispatcher: RouteAgentDispatcher,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, PartialEq, Properties)]
 | 
			
		||||
#[derive(Clone, PartialEq, Eq, Properties)]
 | 
			
		||||
pub struct Props {
 | 
			
		||||
    pub token: String,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -81,7 +81,7 @@ pub struct SelectOption {
 | 
			
		||||
    props: SelectOptionProps,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq, Debug)]
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq, Eq, Debug)]
 | 
			
		||||
pub struct SelectOptionProps {
 | 
			
		||||
    pub value: String,
 | 
			
		||||
    pub text: String,
 | 
			
		||||
 | 
			
		||||
@ -40,7 +40,7 @@ pub enum Msg {
 | 
			
		||||
    OnUserRemovedFromGroup((String, i64)),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq)]
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq, Eq)]
 | 
			
		||||
pub struct Props {
 | 
			
		||||
    pub username: String,
 | 
			
		||||
    pub is_admin: bool,
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@ use wasm_bindgen::JsCast;
 | 
			
		||||
use yew::{prelude::*, services::ConsoleService};
 | 
			
		||||
use yew_form_derive::Model;
 | 
			
		||||
 | 
			
		||||
#[derive(PartialEq, Clone, Default)]
 | 
			
		||||
#[derive(PartialEq, Eq, Clone, Default)]
 | 
			
		||||
struct JsFile {
 | 
			
		||||
    file: Option<web_sys::File>,
 | 
			
		||||
    contents: Option<Vec<u8>>,
 | 
			
		||||
@ -39,7 +39,7 @@ impl FromStr for JsFile {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// 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 {
 | 
			
		||||
    #[validate(email)]
 | 
			
		||||
    email: String,
 | 
			
		||||
@ -55,7 +55,7 @@ pub struct UserModel {
 | 
			
		||||
    schema_path = "../schema.graphql",
 | 
			
		||||
    query_path = "queries/update_user.graphql",
 | 
			
		||||
    response_derives = "Debug",
 | 
			
		||||
    variables_derives = "Clone,PartialEq",
 | 
			
		||||
    variables_derives = "Clone,PartialEq,Eq",
 | 
			
		||||
    custom_scalars_module = "crate::infra::graphql"
 | 
			
		||||
)]
 | 
			
		||||
pub struct UpdateUser;
 | 
			
		||||
@ -80,7 +80,7 @@ pub enum Msg {
 | 
			
		||||
    UserUpdated(Result<update_user::ResponseData>),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq)]
 | 
			
		||||
#[derive(yew::Properties, Clone, PartialEq, Eq)]
 | 
			
		||||
pub struct Props {
 | 
			
		||||
    /// The current user details.
 | 
			
		||||
    pub user: User,
 | 
			
		||||
 | 
			
		||||
@ -265,7 +265,7 @@ pub struct GroupDetails {
 | 
			
		||||
    pub uuid: Uuid,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Debug, Clone, PartialEq)]
 | 
			
		||||
#[derive(Debug, Clone, PartialEq, Eq)]
 | 
			
		||||
pub struct UserAndGroups {
 | 
			
		||||
    pub user: User,
 | 
			
		||||
    pub groups: Option<Vec<GroupDetails>>,
 | 
			
		||||
 | 
			
		||||
@ -562,7 +562,7 @@ where
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Clone, Copy, PartialEq, Debug)]
 | 
			
		||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
 | 
			
		||||
pub enum Permission {
 | 
			
		||||
    Admin,
 | 
			
		||||
    PasswordManager,
 | 
			
		||||
@ -570,7 +570,7 @@ pub enum Permission {
 | 
			
		||||
    Regular,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(Debug, Clone, PartialEq)]
 | 
			
		||||
#[derive(Debug, Clone, PartialEq, Eq)]
 | 
			
		||||
pub struct ValidationResults {
 | 
			
		||||
    pub user: UserId,
 | 
			
		||||
    pub permission: Permission,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user