summaryrefslogtreecommitdiffstats
path: root/tests/get.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-03-14 09:26:51 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-03-14 09:48:59 +0100
commitc26a941541ccd7733f7533372da71f0a5be36ed5 (patch)
tree2ed0a5f2df07dd3dcdbf73af9394cdea5f9df57a /tests/get.rs
parenta3f205dc628b59a32de813b3efefbaec4667d217 (diff)
Rename try_into/try_from
Because of the clash in names with the TryInto and TryFrom traits, we're renaming the functions here to try_serialize/try_deserialize. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'tests/get.rs')
-rw-r--r--tests/get.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/get.rs b/tests/get.rs
index 135d3b0..a8a97d2 100644
--- a/tests/get.rs
+++ b/tests/get.rs
@@ -134,7 +134,7 @@ fn test_map_struct() {
}
let c = make();
- let s: Settings = c.try_into().unwrap();
+ let s: Settings = c.try_deserialize().unwrap();
assert_eq!(s.place.len(), 8);
assert_eq!(
@@ -149,7 +149,7 @@ fn test_file_struct() {
let c = make();
// Deserialize the entire file as single struct
- let s: Settings = c.try_into().unwrap();
+ let s: Settings = c.try_deserialize().unwrap();
assert!(s.debug.approx_eq_ulps(&1.0, 2));
assert_eq!(s.production, Some("false".to_string()));
@@ -197,7 +197,7 @@ fn test_struct_array() {
}
let c = make();
- let s: Settings = c.try_into().unwrap();
+ let s: Settings = c.try_deserialize().unwrap();
assert_eq!(s.elements.len(), 10);
assert_eq!(s.elements[3], "4".to_string());
@@ -219,7 +219,7 @@ fn test_enum() {
}
let c = make();
- let s: Settings = c.try_into().unwrap();
+ let s: Settings = c.try_deserialize().unwrap();
assert_eq!(s.diodes["green"], Diode::Off);
assert_eq!(s.diodes["red"], Diode::Brightness(100));
@@ -254,7 +254,7 @@ fn test_enum_key() {
}
let c = make();
- let s: Settings = c.try_into().unwrap();
+ let s: Settings = c.try_deserialize().unwrap();
assert_eq!(s.proton[&Quark::Up], 2);
assert_eq!(s.quarks.len(), 6);
@@ -268,7 +268,7 @@ fn test_int_key() {
}
let c = make();
- let s: Settings = c.try_into().unwrap();
+ let s: Settings = c.try_deserialize().unwrap();
assert_eq!(s.divisors[&4], 3);
assert_eq!(s.divisors.len(), 4);
}