make derive not do a trait

This commit is contained in:
Joe Ardent 2023-06-13 22:08:28 -07:00
parent 62955548bb
commit f456e07559
3 changed files with 2 additions and 6 deletions

View file

@ -28,7 +28,7 @@ pub fn derive_optional_optional_user(input: TokenStream) -> TokenStream {
}; };
let output = quote!( let output = quote!(
impl crate::templates::OptionalOptionalUser for #name { impl #name {
fn has_optional_user(&self) -> bool { fn has_optional_user(&self) -> bool {
use ::std::any::Any; use ::std::any::Any;
#has_user #user_is_option_user #has_user #user_is_option_user

View file

@ -4,10 +4,6 @@ use serde::{Deserialize, Serialize};
use crate::User; use crate::User;
pub trait OptionalOptionalUser {
fn has_optional_user(&self) -> bool;
}
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)] #[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
#[template(path = "signup.html")] #[template(path = "signup.html")]
pub struct CreateUser { pub struct CreateUser {

View file

@ -2,7 +2,7 @@ use askama::Template;
use optional_optional_user::OptionalOptionalUser; use optional_optional_user::OptionalOptionalUser;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::{templates::OptionalOptionalUser, User, Watch}; use crate::{User, Watch};
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)] #[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
#[template(path = "get_watches.html")] #[template(path = "get_watches.html")]