Skip to content

Commit c629cbd

Browse files
committed
TryFrom's associated type was changed from Err to Error
rust-lang/rust#40281
1 parent 12daa64 commit c629cbd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

derive_builder_core/src/setter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl<'a> ToTokens for Setter<'a> {
129129
tokens.append(quote!(
130130
#(#attrs)*
131131
#vis fn #try_ident #try_ty_params (#self_param, value: VALUE)
132-
-> #result<#return_ty, VALUE::Err>
132+
-> #result<#return_ty, VALUE::Error>
133133
{
134134
let converted : #ty = value.try_into()?;
135135
let mut new = #self_into_return_ty;
@@ -269,7 +269,7 @@ mod tests {
269269

270270
#[some_attr]
271271
pub fn try_foo<VALUE: ::std::convert::TryInto<Foo>>(&mut self, value: VALUE)
272-
-> ::std::result::Result<&mut Self, VALUE::Err> {
272+
-> ::std::result::Result<&mut Self, VALUE::Error> {
273273
let converted : Foo = value.try_into()?;
274274
let mut new = self;
275275
new.foo = ::std::option::Option::Some(converted);
@@ -330,7 +330,7 @@ mod tests {
330330
}
331331

332332
pub fn try_foo<VALUE: ::std::convert::TryInto<Foo>>(&mut self, value: VALUE)
333-
-> ::std::result::Result<&mut Self, VALUE::Err> {
333+
-> ::std::result::Result<&mut Self, VALUE::Error> {
334334
let converted : Foo = value.try_into()?;
335335
let mut new = self;
336336
new.foo = ::std::option::Option::Some(converted);

derive_builder_test/tests/try_setter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ mod struct_level {
2424

2525
#[cfg(feature = "nightlytests")]
2626
impl<'a> TryFrom<&'a str> for MyAddr {
27-
type Err = AddrParseError;
27+
type Error = AddrParseError;
2828

29-
fn try_from(v: &str) -> Result<Self, Self::Err> {
29+
fn try_from(v: &str) -> Result<Self, Self::Error> {
3030
Ok(MyAddr(v.parse()?))
3131
}
3232
}

0 commit comments

Comments
 (0)