Skip to content

Commit

Permalink
move struct definitions into test function
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Labeyrie authored and dralley committed Jun 4, 2023
1 parent aa58595 commit 8736d7b
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,23 +671,21 @@ mod indentation {
);
}

#[cfg(feature = "serialize")]
#[derive(Serialize)]
struct Foo {
bar: Bar,
val: String,
}

#[cfg(feature = "serialize")]
#[derive(Serialize)]
struct Bar {
baz: usize,
bat: usize,
}

#[cfg(feature = "serialize")]
#[test]
fn element_writer_serialize() {
#[derive(Serialize)]
struct Foo {
bar: Bar,
val: String,
}

#[derive(Serialize)]
struct Bar {
baz: usize,
bat: usize,
}

let mut buffer = Vec::new();
let mut writer = Writer::new_with_indent(&mut buffer, b' ', 4);
let content = Foo {
Expand Down

0 comments on commit 8736d7b

Please sign in to comment.