From c26a941541ccd7733f7533372da71f0a5be36ed5 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 14 Mar 2021 09:26:51 +0100 Subject: 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 --- tests/errors.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/errors.rs') diff --git a/tests/errors.rs b/tests/errors.rs index ec96c98..04f11fe 100644 --- a/tests/errors.rs +++ b/tests/errors.rs @@ -56,7 +56,7 @@ fn test_error_type_detached() { let c = make(); let value = c.get::("boolean_s_parse").unwrap(); - let res = value.try_into::(); + let res = value.try_deserialize::(); assert!(res.is_err()); assert_eq!( @@ -76,14 +76,14 @@ fn test_error_enum_de() { } let on_v: Value = "on".into(); - let on_d = on_v.try_into::(); + let on_d = on_v.try_deserialize::(); assert_eq!( on_d.unwrap_err().to_string(), "enum Diode does not have variant constructor on".to_string() ); let array_v: Value = vec![100, 100].into(); - let array_d = array_v.try_into::(); + let array_d = array_v.try_deserialize::(); assert_eq!( array_d.unwrap_err().to_string(), "value of enum Diode should be represented by either string or table with exactly one key" @@ -97,7 +97,7 @@ fn test_error_enum_de() { .cloned() .collect::>() .into(); - let confused_d = confused_v.try_into::(); + let confused_d = confused_v.try_deserialize::(); assert_eq!( confused_d.unwrap_err().to_string(), "value of enum Diode should be represented by either string or table with exactly one key" @@ -122,7 +122,7 @@ inner: let mut cfg = Config::new(); cfg.merge(File::from_str(CFG, FileFormat::Yaml)).unwrap(); - let e = cfg.try_into::().unwrap_err(); + let e = cfg.try_deserialize::().unwrap_err(); if let ConfigError::Type { key: Some(path), .. } = e -- cgit v1.2.3