make derive not do a trait
This commit is contained in:
parent
62955548bb
commit
f456e07559
3 changed files with 2 additions and 6 deletions
|
@ -28,7 +28,7 @@ pub fn derive_optional_optional_user(input: TokenStream) -> TokenStream {
|
|||
};
|
||||
|
||||
let output = quote!(
|
||||
impl crate::templates::OptionalOptionalUser for #name {
|
||||
impl #name {
|
||||
fn has_optional_user(&self) -> bool {
|
||||
use ::std::any::Any;
|
||||
#has_user #user_is_option_user
|
||||
|
|
|
@ -4,10 +4,6 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use crate::User;
|
||||
|
||||
pub trait OptionalOptionalUser {
|
||||
fn has_optional_user(&self) -> bool;
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
|
||||
#[template(path = "signup.html")]
|
||||
pub struct CreateUser {
|
||||
|
|
|
@ -2,7 +2,7 @@ use askama::Template;
|
|||
use optional_optional_user::OptionalOptionalUser;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{templates::OptionalOptionalUser, User, Watch};
|
||||
use crate::{User, Watch};
|
||||
|
||||
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
|
||||
#[template(path = "get_watches.html")]
|
||||
|
|
Loading…
Reference in a new issue