use relax::Relax; #[derive(Relax, Debug, PartialEq)] #[relax(PartialFoo, derive(Debug, PartialEq), doc = "partial foo")] pub struct Foo { #[relax] pub bar_1: Bar, #[relax] pub bar_2: Option, } #[derive(Relax, Debug, PartialEq)] #[relax(PartialBar, doc = "partial bar", derive(Debug, PartialEq))] pub struct Bar { pub id: u16, } #[test] fn extra_attrs() { let partial_bar = PartialBar { id: Some(42) }; let partial_foo = PartialFoo { bar_1: Some(partial_bar), bar_2: None, }; let expected_partial_foo = PartialFoo { bar_1: Some(PartialBar { id: Some(42) }), bar_2: None, }; assert_eq!(partial_foo, expected_partial_foo); }