You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return Err(ErrKind::Foo.into()) and Err(ErrKind::Foo)? are both accepted.
There shouldn't be two ways of doing the same thing and the latter is more succint.
Advantage
Less code
Unified way of doing things
Drawbacks
Can be annoying.
Unclear if we want to emit where there's no .into()
Example
returnErr(ErrKind::Foo.into())
Could be written as:
Err(ErrKind::Foo)?
The text was updated successfully, but these errors were encountered:
What it does
return Err(ErrKind::Foo.into())
andErr(ErrKind::Foo)?
are both accepted.There shouldn't be two ways of doing the same thing and the latter is more succint.
Advantage
Drawbacks
.into()
Example
Could be written as:
The text was updated successfully, but these errors were encountered: