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
The `throws` macro now takes an optional `as TYPE` argument. If this is
present, instead of transforming the return type to `Result`, it transforms it
to `TYPE` parameterized by the return and error types.
The error type is optional as well: if no error type is present, the wrapper
type is parameterized only by the return type.
This allows you to write `#[throws(as Option)]` to make a throwing function
that returns an option.
It also supports other try types.
Syntactically, these two should both work and be equivalent:
`#[throws(io::Error as Poll<Result>)]`
`#[throws(as Poll<io::Result>)]`
However, these do not work because of the way the return type needs to be
wrapped in poll. More thought needs to go into how to support the Poll types.
0 commit comments