diff options
author | Melody Horn <melody@boringcactus.com> | 2021-06-30 17:06:02 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-06-30 17:06:02 -0600 |
commit | 85d53a3358819d15788e1196d110fb6fd7199c67 (patch) | |
tree | 6d8a8ea21ed967c13fafa5fa90e133e6e75f8f84 /tosin-macros | |
parent | bc874c9d1363d3bf8865ea7a629eb976e23386b3 (diff) | |
download | tosin-85d53a3358819d15788e1196d110fb6fd7199c67.tar.gz tosin-85d53a3358819d15788e1196d110fb6fd7199c67.zip |
delete gather_migrations since it gets miscached
Diffstat (limited to 'tosin-macros')
-rw-r--r-- | tosin-macros/src/lib.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/tosin-macros/src/lib.rs b/tosin-macros/src/lib.rs index 5773075..f9d8fc0 100644 --- a/tosin-macros/src/lib.rs +++ b/tosin-macros/src/lib.rs @@ -295,36 +295,6 @@ fn impl_model(ast: &syn::DeriveInput) -> TokenStream { } #[proc_macro] -pub fn gather_migrations(_input: TokenStream) -> TokenStream { - let call_site = proc_macro::Span::call_site(); - let call_site_file = call_site.source_file(); - let call_site_path = call_site_file.path(); - if !call_site_file.is_real() { - panic!("call site does not have a real path"); - } - - let migrations_dir = call_site_path.parent().unwrap(); - let migrations: Vec<syn::Ident> = migrations_dir - .read_dir() - .unwrap() - .map(Result::unwrap) - .map(|x| x.path().file_stem().unwrap().to_string_lossy().into_owned()) - .filter(|x| x != "mod") - .map(|x| syn::parse_str(&x).unwrap()) - .collect(); - - let gen = quote! { - #( mod #migrations; )* - - pub const ALL: &[Migration] = &[ - #(#migrations::MIGRATION),* - ]; - }; - - gen.into() -} - -#[proc_macro] pub fn gather_models(_input: TokenStream) -> TokenStream { let call_site = proc_macro::Span::call_site(); let call_site_file = call_site.source_file(); |