From c629cbd1b1ed8662dac9d21ab960d9999fc2f1e0 Mon Sep 17 00:00:00 2001 From: Ted Driggs Date: Tue, 11 Apr 2017 16:46:05 -0700 Subject: [PATCH] TryFrom's associated type was changed from Err to Error https://github.com/rust-lang/rust/pull/40281 --- derive_builder_core/src/setter.rs | 6 +++--- derive_builder_test/tests/try_setter.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/derive_builder_core/src/setter.rs b/derive_builder_core/src/setter.rs index 0d6ea26d..1841c1c7 100644 --- a/derive_builder_core/src/setter.rs +++ b/derive_builder_core/src/setter.rs @@ -129,7 +129,7 @@ impl<'a> ToTokens for Setter<'a> { tokens.append(quote!( #(#attrs)* #vis fn #try_ident #try_ty_params (#self_param, value: VALUE) - -> #result<#return_ty, VALUE::Err> + -> #result<#return_ty, VALUE::Error> { let converted : #ty = value.try_into()?; let mut new = #self_into_return_ty; @@ -269,7 +269,7 @@ mod tests { #[some_attr] pub fn try_foo>(&mut self, value: VALUE) - -> ::std::result::Result<&mut Self, VALUE::Err> { + -> ::std::result::Result<&mut Self, VALUE::Error> { let converted : Foo = value.try_into()?; let mut new = self; new.foo = ::std::option::Option::Some(converted); @@ -330,7 +330,7 @@ mod tests { } pub fn try_foo>(&mut self, value: VALUE) - -> ::std::result::Result<&mut Self, VALUE::Err> { + -> ::std::result::Result<&mut Self, VALUE::Error> { let converted : Foo = value.try_into()?; let mut new = self; new.foo = ::std::option::Option::Some(converted); diff --git a/derive_builder_test/tests/try_setter.rs b/derive_builder_test/tests/try_setter.rs index acdf5e17..49d28086 100644 --- a/derive_builder_test/tests/try_setter.rs +++ b/derive_builder_test/tests/try_setter.rs @@ -24,9 +24,9 @@ mod struct_level { #[cfg(feature = "nightlytests")] impl<'a> TryFrom<&'a str> for MyAddr { - type Err = AddrParseError; + type Error = AddrParseError; - fn try_from(v: &str) -> Result { + fn try_from(v: &str) -> Result { Ok(MyAddr(v.parse()?)) } }