libstd: Add unwrap_or and unwrap_or_handle to Result#13475
libstd: Add unwrap_or and unwrap_or_handle to Result#13475bors merged 1 commit intorust-lang:masterfrom
Conversation
|
I believe the current idea with the |
|
Oh, hm. Does anybody remember why we kept |
|
Well, I r+'d based on existing standards. |
|
@brson I think |
|
@sfackler Yeah that sounds reasonable. I don't recall why we removed the |
|
In the old implementation, all methods required a |
It might make more sense to mirror `Option`'s `unwrap_or_else` but I've left it as `handle` as it feels more explicit about the signature difference.
…, r=flodiebold fix: Test all generic args for trait when finding matching impl Addresses rust-lang/rust-analyzer#13463 (comment) When finding matching impl for a trait method, we've been testing the unifiability of self type. However, there can be multiple impl of a trait for the same type with different generic arguments for the trait. This patch takes it into account and tests the unifiability of all type arguments for the trait (the first being the self type) thus enables rust-analyzer to find the correct impl even in such cases.
It might make more sense to mirror
Option'sunwrap_or_elsebut I've left it ashandleas it feels more explicit about the signature difference.