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 main advantage of this, in my opinion, is that is avoids the boilerplate handling of Err(e) => return Err(e). When multiple such error handling blocks are adjacent, this adds up to a lot of unnecessary noise.
A situation I repeatedly find myself in is wanting to handle one specific error type and raise all others. For example:
In this case, I think it could be more readable as:
The main advantage of this, in my opinion, is that is avoids the boilerplate handling of
Err(e) => return Err(e)
. When multiple such error handling blocks are adjacent, this adds up to a lot of unnecessary noise.In my project, I can implement this as:
but it might be useful enough to other PyO3 users to upstream.
The text was updated successfully, but these errors were encountered: