From 80411fde164106189b5a83c2115954f5cc719cab Mon Sep 17 00:00:00 2001 From: XdoctorwhoZ Date: Sun, 4 Aug 2024 14:57:08 +0100 Subject: [PATCH] cleaun --- Cargo.toml | 1 - lib/panduza-proc/Cargo.toml | 11 --------- lib/panduza-proc/src/lib.rs | 48 ------------------------------------- 3 files changed, 60 deletions(-) delete mode 100644 lib/panduza-proc/Cargo.toml delete mode 100644 lib/panduza-proc/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 5e5df0c..ad1b693 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ monitor = "0.1.0" bytes = "1.0.1" thiserror = "1.0.63" -panduza-proc = { path = "lib/panduza-proc" } tokio = { version = "1", features = ["full"] } diff --git a/lib/panduza-proc/Cargo.toml b/lib/panduza-proc/Cargo.toml deleted file mode 100644 index 516ece9..0000000 --- a/lib/panduza-proc/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "panduza-proc" -version = "0.0.0" -edition = "2021" - -[lib] -proc-macro = true - -[dependencies] -quote = "1.0.9" -syn = "2.0.72" diff --git a/lib/panduza-proc/src/lib.rs b/lib/panduza-proc/src/lib.rs deleted file mode 100644 index 58a86d8..0000000 --- a/lib/panduza-proc/src/lib.rs +++ /dev/null @@ -1,48 +0,0 @@ - - - -extern crate proc_macro; -extern crate syn; -#[macro_use] -extern crate quote; -use proc_macro::TokenStream; -use quote::quote; -use syn::{parse_macro_input, DeriveInput}; - - -// il faut aussi utiliser les proc attributes pour les attributs et non pas derive - - -#[proc_macro_derive(HelloWorld)] -pub fn hello_world(input: TokenStream) -> TokenStream { - - let input = parse_macro_input!(input as DeriveInput); - - - let name = input.ident; - - // Build the output, possibly using quasi-quotation - let expanded = quote! { - - impl HelloWorld for #name { - fn hello_world() { - println!("Hello, World! My name is {}", stringify!(#name)); - } - } - - }; - - // Hand the output tokens back to the compiler - TokenStream::from(expanded) -} - -// fn impl_hello_world(ast: &syn::DeriveInput) -> quote::ToTokens { -// let name = &ast.ident; -// quote! { -// impl HelloWorld for #name { -// fn hello_world() { -// println!("Hello, World! My name is {}", stringify!(#name)); -// } -// } -// } -// }