4 ms·
Can we please deprecate the "as" operator? Something so lossy and ill-conceived should not be a two-letter operator.
by devit 6y ago
Can we please deprecate the "as" operator?
Something so lossy and ill-conceived should not be a two-letter operator.
- steveklabnik 6y agoIt is possible, someone needs to do the RFC work. I would say that my personal take of the temperature is "vaguely pro but not a slam dunk", at least from the opinions I've seen. Only one way to find out.
- 95th 6y agoThen what do you propose for replacement? C++ style casts `(int) x` ?
- stefano_c 6y agoWhat would you suggest for replacing e.g. `u8 as usize`?
- steveklabnik 6y agoFor this one, you could use From/Into, because it cannot fail. For numerics that can fail, TryFrom/TryInto. The numeric casts are the easy part of this.