Skip to content

Commit a8f8bf6

Browse files
Rémi Labeyriedralley
Rémi Labeyrie
authored andcommitted
move struct definitions into test function
1 parent 78c4787 commit a8f8bf6

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/writer.rs

+12-14
Original file line numberDiff line numberDiff line change
@@ -671,23 +671,21 @@ mod indentation {
671671
);
672672
}
673673

674-
#[cfg(feature = "serialize")]
675-
#[derive(Serialize)]
676-
struct Foo {
677-
bar: Bar,
678-
val: String,
679-
}
680-
681-
#[cfg(feature = "serialize")]
682-
#[derive(Serialize)]
683-
struct Bar {
684-
baz: usize,
685-
bat: usize,
686-
}
687-
688674
#[cfg(feature = "serialize")]
689675
#[test]
690676
fn element_writer_serialize() {
677+
#[derive(Serialize)]
678+
struct Foo {
679+
bar: Bar,
680+
val: String,
681+
}
682+
683+
#[derive(Serialize)]
684+
struct Bar {
685+
baz: usize,
686+
bat: usize,
687+
}
688+
691689
let mut buffer = Vec::new();
692690
let mut writer = Writer::new_with_indent(&mut buffer, b' ', 4);
693691
let content = Foo {

0 commit comments

Comments
 (0)