Recently the commit adding TryFrom/TryInto to prelude is reverted as we figured out that this can break some stable code. But as those traits can’t be so useful if they aren’t included in prelude, libs team will explore to do it without serious breakage.
This means it’s a perfect chance to duscuss what more should be added to prelude! Here’s my proposals from my own practice.
std is the single most use case of absolute path syntax like
::std::vec::Iter. And who want to use this name for another thing?
Default is nice, mostly because they’re
Default::default() is sometimes too verbose, and
default() is clear enough to inform to construct some default value.
These are useful for simple example code to introduce rust language to newcommers, and they have crystal clear names.
Please comment if you like/dislike some proposals above, or have another proposal like them.