I would like to nominate `Option::as_deref` for the worst named method in Rust
-
-
Replying to @sgrif
what would you call it? ... i remember being kind of frustrated by how long it was unstable because of that particular bikeshed, and it’s really way nicer than .map(|x| &*x)
2 replies 0 retweets 0 likes -
Replying to @at_tcsc
First preference: `Deref` was just structured in a way it could be implemented by `Option<impl Deref>`. Second preference: Inherent method called `deref` Third+ preference: Something that implies it's *calling* deref on its member, e.g. `derefed`.
2 replies 0 retweets 0 likes
The current name implies to me that the return type is `Option<Box<dyn Deref>>` (yes I know you'd need to specify a concrete type for target)
3:19 PM - 29 Jun 2020
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.