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
(Assuming we bump the MSRV to 1.57 for try_reserve...)
That's certainly possible, but I don't think it's a good idea, because the current purpose of those methods is only to detect arithmetic overflow. I think it would be semantically confusing for this to also conflate OOM.
Maybe it would make sense to have try_op methods which return a Result, and the error type could indicate the type of failure. It may be difficult to thread this through the more complicated operations though, like multiplication and division.
With
try_reserve
available forVec
, the checked operations (e.g. checked_add) could returnNone
when out of memory.Is this extension possible in checked traits?
The text was updated successfully, but these errors were encountered: