jhpratt / deranged

Proof of concept ranged integers in Rust.
Apache License 2.0
38 stars 5 forks source link

Add USize and ISize types #3

Closed shelvacu closed 3 years ago

shelvacu commented 3 years ago

Also relevant "TryFrom" impls

jhpratt commented 3 years ago

Keep in mind that pointer-sized integers can be 16, 32, or 64 bits — this assumes they are always 64. Additionally, please only have the first letter be capitalized to conform with standard casing practice.

shelvacu commented 3 years ago

I don't see where any pointer size is assumed, the only into impl is usize or isize, everyithing other type is under try_into. The compiler will complain even if you try to convert usize into u128.

Fixed the capitalization.

jhpratt commented 3 years ago

Upon quick glance it does appear that usize doesn't implement Into<u128>, contrary to my assumption. As such I will review the PR as-is when I get time. I know it's small but I need to get some things done before starting in a new position. My best guess is I'll be able to review this during the gap in RustConf on Tuesday. I will cut a new release once it's merged, though.

jhpratt commented 3 years ago

This actually made me realize that impl TryFrom<I8<…>> for I16<…> and similar doesn't exist even though it could/should. That's not an issue with this PR, though.