Skip to content

Commit

Permalink
TryFrom's associated type was changed from Err to Error
Browse files Browse the repository at this point in the history
  • Loading branch information
TedDriggs committed Apr 11, 2017
1 parent 12daa64 commit c629cbd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions derive_builder_core/src/setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -269,7 +269,7 @@ mod tests {

#[some_attr]
pub fn try_foo<VALUE: ::std::convert::TryInto<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);
Expand Down Expand Up @@ -330,7 +330,7 @@ mod tests {
}

pub fn try_foo<VALUE: ::std::convert::TryInto<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);
Expand Down
4 changes: 2 additions & 2 deletions derive_builder_test/tests/try_setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self, Self::Err> {
fn try_from(v: &str) -> Result<Self, Self::Error> {
Ok(MyAddr(v.parse()?))
}
}
Expand Down

0 comments on commit c629cbd

Please sign in to comment.