diff options
author | Florian Klink <flokli@flokli.de> | 2023-08-19T14·38+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-08-20T21·43+0000 |
commit | 600d4eec775c0b3df3365ea0ffdcfe449527e630 (patch) | |
tree | 2cf6c1b4818cf5cf59f020461d4c35976a30b94a /tvix/serde/src/de_tests.rs | |
parent | 9cb38c5ba5e51e8843ee2ab210842701c5a6d7ce (diff) |
refactor(tvix/serde): cargo clippy r/6497
Change-Id: I3c86225040a04c9cb5702b226b4a5008ae219c42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9093 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/serde/src/de_tests.rs')
-rw-r--r-- | tvix/serde/src/de_tests.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tvix/serde/src/de_tests.rs b/tvix/serde/src/de_tests.rs index 9764653caa86..807d953c77fa 100644 --- a/tvix/serde/src/de_tests.rs +++ b/tvix/serde/src/de_tests.rs @@ -161,24 +161,24 @@ fn deserialize_enum_all() { #[derive(Debug, Deserialize, PartialEq)] #[serde(rename_all = "snake_case")] enum TestEnum { - UnitVariant, - TupleVariant(String, String), - StructVariant { name: String, age: usize }, + Unit, + Tuple(String, String), + Struct { name: String, age: usize }, } let result: Vec<TestEnum> = from_str( r#" let - mkTuple = country: drink: { tuple_variant = [ country drink ]; }; + mkTuple = country: drink: { tuple = [ country drink ]; }; in [ (mkTuple "UK" "cask ale") - "unit_variant" + "unit" { - struct_variant.name = "Slartibartfast"; - struct_variant.age = 42; + struct.name = "Slartibartfast"; + struct.age = 42; } (mkTuple "Russia" "квас") @@ -188,13 +188,13 @@ fn deserialize_enum_all() { .expect("should deserialize"); let expected = vec![ - TestEnum::TupleVariant("UK".into(), "cask ale".into()), - TestEnum::UnitVariant, - TestEnum::StructVariant { + TestEnum::Tuple("UK".into(), "cask ale".into()), + TestEnum::Unit, + TestEnum::Struct { name: "Slartibartfast".into(), age: 42, }, - TestEnum::TupleVariant("Russia".into(), "квас".into()), + TestEnum::Tuple("Russia".into(), "квас".into()), ]; assert_eq!(result, expected); |