#prelude #std #stdlib

std_prelude

prelude that the rust stdlib should have always had

10 releases

Uses old Rust 2015

0.2.12 Feb 8, 2018
0.2.11 Jan 27, 2018
0.2.9 Nov 28, 2017

#1450 in Rust patterns

Download history 14079/week @ 2023-11-23 18231/week @ 2023-11-30 17874/week @ 2023-12-07 14600/week @ 2023-12-14 13358/week @ 2023-12-21 17468/week @ 2023-12-28 18716/week @ 2024-01-04 19615/week @ 2024-01-11 17384/week @ 2024-01-18 15854/week @ 2024-01-25 17995/week @ 2024-02-01 18934/week @ 2024-02-08 20715/week @ 2024-02-15 21190/week @ 2024-02-22 22516/week @ 2024-02-29 13180/week @ 2024-03-07

80,702 downloads per month
Used in 102 crates (7 directly)

MIT license

11KB
50 lines

extended stdlib prelude

To use, add to your Crates.io and write

extern crate std_prelude;
use std_prelude::*;

// you now have access to HashMap, io::Write, str::FromStr, etc.

For a full list of the items that are imported, see the crate documentation

This library is to add several "often used" traits, structs and methods that (in the opinionated version of this author) should have been included in the stdlib all along. It is incredubly annoying to call (for instance) Vec::from_iter only to find you need to import a pretty standard trait into scope (FromIterator). This crate hopes to reduce the pain of this papercut.

The author of this crate wants the rust community itself to decide which items should be included here. If this crate becomes useful enough, it is the intention of this author to give ownership of this crate to the rustlang-nursery or a similiar originization.

This library is at the very early stages of development, so stability is not yet guaranteed. What I mostly want is feedback. Am I missing items that should "almost always" be imported? Are there ones that shouldn't be there? Should I be including modules like io, fmt, etc as part of the prelude?

If you think any of these things are true, please open an issue!

Guarantees

I offer the following guarantees for this lib

  • Once at v1.0 (fairly soon) all new versions of std_prelude will increment the MAJOR version (1.0.0 -> 2.0.0) since the changes will probably cause compiler breakages (things people imported won't need to be imported anymore)

No runtime deps