Posted on ::

(see Rust dreams for a similar list, but for the language)

Here are things I wish could be changed in the Rust standard library (std).

  • Remove std, and retain alloc without any of the types in collections module.

    That removed code can have official status (to retain trust), maybe even distributed with rustup (to retain convenience).

  • Rename Vec to Array, a more clear/obvious name. An alternative is List, but that type in Python accepts members of different types, which is not the case for Vec.

  • Consistent names for string-y types:

    currentwish
    stringstrStr
    StringStrOwned
    os stringOsStrOsStr (same)
    OsStringOsStrOwned
    C stringCStrCStr (same)
    CStringCStrOwned
    fs pathPathPath (same)
    PathBufPathOwned
  • Remove std::sync::mpsc from stdlib, making it available externally... it does not feel general enough. (more issues)

  • Remove per-type methods where trait impls offer same functionality, for generality:

    currentwish
    PathBuf::as_pathPathBuf::as_ref
    Path::to_path_bufPath::to_owned
    Vec::appendVec::extend
  • Remove all deprecated APIs, most notable being the try! macro

  • Renames of panic methods (inspiration)

    currentwish
    foo.unwrap(remove)
    foo.expect("message")foo.or_panic("message")
    foo.unwrap_orfoo.or
    foo.unwrap_or_defaultfoo.or_default
    foo.unwrap_or_elsefoo.or_else

    It feels somewhat implicit, but maybe not so bad.