From f3228919908d322479aa55106b876f3ef7e437f9 Mon Sep 17 00:00:00 2001 From: Mingun Date: Sun, 22 May 2022 23:01:07 +0500 Subject: [PATCH] Move struct inside test function where it only used --- tests/serde-migrated.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/serde-migrated.rs b/tests/serde-migrated.rs index 82d65963..5dfc7b87 100644 --- a/tests/serde-migrated.rs +++ b/tests/serde-migrated.rs @@ -6,14 +6,6 @@ use serde::{Deserialize, Serialize}; use pretty_assertions::assert_eq; -#[derive(PartialEq, Debug, Serialize, Deserialize)] -enum Animal { - Dog, - Frog(String), - Ant(Simple), - Cat { age: usize, name: String }, -} - #[derive(PartialEq, Debug, Serialize, Deserialize)] struct Simple { a: (), @@ -126,7 +118,15 @@ fn test_parse_string_not_trim() { #[test] #[ignore] // FIXME fn test_parse_enum() { - use self::Animal::*; + use Animal::*; + + #[derive(PartialEq, Debug, Serialize, Deserialize)] + enum Animal { + Dog, + Frog(String), + Ant(Simple), + Cat { age: usize, name: String }, + } test_parse_ok(&[ ("", Dog),