Skip to content

Commit

Permalink
Merge pull request #99 from andrewbaxter/remove-dump-test2
Browse files Browse the repository at this point in the history
Fix #97: Remove test blocking CI
  • Loading branch information
andrewbaxter authored Dec 15, 2024
2 parents dea62dc + 508dd10 commit dc49e22
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions crates/aargvark_proc_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,26 +726,3 @@ pub fn derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
Err(e) => e.to_compile_error(),
}.into();

Check warning on line 727 in crates/aargvark_proc_macros/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

unneeded `return` statement

warning: unneeded `return` statement --> crates/aargvark_proc_macros/src/lib.rs:724:5 | 724 | / return match gen_impl(parse_macro_input!(input as DeriveInput)) { 725 | | Ok(x) => x, 726 | | Err(e) => e.to_compile_error(), 727 | | }.into(); | |____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 724 ~ match gen_impl(parse_macro_input!(input as DeriveInput)) { 725 + Ok(x) => x, 726 + Err(e) => e.to_compile_error(), 727 ~ }.into() |
}

#[cfg(test)]
mod tests {
use genemichaels_lib::FormatConfig;
use quote::quote;
use crate::gen_impl;

/// Used for debugging only, ignore
#[test]
fn dump() {
let got = gen_impl(syn::parse2(quote!{
#[derive(Aargvark, PartialEq, Debug)]
struct Naya {
b: Option<()>,
}
}).unwrap()).unwrap();
let cfg = FormatConfig::default();
let mut s =
[&got].into_iter().map(|s| genemichaels_lib::format_str(&s.to_string(), &cfg)).collect::<Vec<_>>();
let got = s.remove(0).expect(&format!("Failed to format got code:\n{}", got.to_string())).rendered;
panic!("{}", got);
}
}

0 comments on commit dc49e22

Please sign in to comment.