There's a great debate on a shopping list of things we don't have:
Unless you're pulling in the num-traits crate, life is still pretty unpleasant if you want to do anything generic across all the integer types that rust has. There are hacks to get everything you need but it's ugly and not anything that you would want to show to a beginner. Is there any reason why we can't add a NumInfo
trait to give the basics of MAX, MIN, BITS, is_signed(), ZERO, ONE?
Computers are generally used to process numbers and strings so it's helpful to adoption if we can do both of these out of the box without needing external crates.
People say that one and zero are not necessary for std lib but we want people to read rust code and understand it and having zero and one being explicit would make code more readable and simpler to understand.
(If there's a related PR/Issue that I missed please point me at it)
To me this feels like we just have not got round to joining the dots. This feels fairly uncontroversial (waiting to be disabused of this notion!) so I thought I would ask here and find out if there's any reason not to raise a PR so we can see how it feels in nightly...