Josh Stone

Results 823 comments of Josh Stone

#426 uses `MaybeUninit` *without* unsafe code by eagerly dropping the unused part, also taking advantage of the specialization that lets `vec.into_iter().map(..).collect()` work in-place.

> [rust-lang/libs-team#707](https://github.com/rust-lang/libs-team/issues/707) would eventually rely on this (as per my implementation) so could we expedite support? I would not expect the standard library to start using `num-traits`, *especially* because that...

The old types are just aliases now, literally `type NonZeroI32 = NonZero;` etc. So implementing traits here on those aliases has exactly the same effect as implementing `NonZero` for specific...

I'm torn on `AsPrimitive` -- right now that is only implement for types where you could literally write `x as T` in non-generic settings. It's not sealed though, and the...

> > I'm torn on `AsPrimitive` -- [...] > > It was requested in #335, they have a use case for it. Let me know if you want to keep...

> To me, a big part of the value of add-on crates like the `rust-num` collection is that they can help make up where the base language falls short. >...

`HashTable` has mostly avoided unsafe methods, except for `get_many_unchecked_mut`. Maybe we can add something that returns `Result

FWIW, `indexmap` could use this idea for a cleaner panic here: https://github.com/indexmap-rs/indexmap/blob/1818d4140d86aeef18c515f1b060a3fa68da2708/src/map/core.rs#L86 (but I do want to stick to safe APIs as much as possible)

> This trait _should_ theoretically be a supertrait of `PrimInt`. However, this trait (like `NumOps: Rem`), requires `CheckedRem`. `PrimInt` does not currently require that, meaning that this would be a...