I am completely certain that if I proposed deref coercions today there would be a crowd up in arms about how important it is that they know that the address-of and period operators don't run arbitrary code.
-
-
Replying to @withoutboats
Is this the new-ish feature that enables us to not have to write `.as_ref()` / `ref` / `*` inside match statements all the time? (I like that feature a lot!)
1 reply 0 retweets 1 like -
Replying to @yoshuawuyts
No (but people were up in arms about that!). Its the much older feature that lets you call `.len()` on a Vec even though `.len` is a method on slice, instead of having to do `vec[].as_slice().len()`
3 replies 0 retweets 3 likes -
Replying to @withoutboats @yoshuawuyts
Its also the reason we don't have `foo->bar` like you see in C. We automatically dereference types to find their methods, including possibly running user-defined code in Deref impls.
1 reply 0 retweets 5 likes
Oh yeah, I've used Deref a bunch before -- it's pretty cool! Thanks for explaining!
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.