]> git.lizzy.rs Git - rust.git/commit
std: Tweak the std::env OsString/String interface
authorAlex Crichton <alex@alexcrichton.com>
Wed, 11 Feb 2015 19:47:53 +0000 (11:47 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 11 Feb 2015 21:46:35 +0000 (13:46 -0800)
commita828e7948069f310dc5b33be8edb65e5e8e0cf9a
tree9806752d95d3ddeb06276eae62fe7b97fe0b1e4e
parent446bc899b28e988f4252beca0d1858e7f7d866b1
std: Tweak the std::env OsString/String interface

This commit tweaks the interface of the `std::env` module to make it more
ergonomic for common usage:

* `env::var` was renamed to `env::var_os`
* `env::var_string` was renamed to `env::var`
* `env::args` was renamed to `env::args_os`
* `env::args` was re-added as a panicking iterator over string values
* `env::vars` was renamed to `env::vars_os`
* `env::vars` was re-added as a panicking iterator over string values.

This should make common usage (e.g. unicode values everywhere) more ergonomic
as well as "the default". This is also a breaking change due to the differences
of what's yielded from each of these functions, but migration should be fairly
easy as the defaults operate over `String` which is a common type to use.

[breaking-change]
21 files changed:
src/compiletest/compiletest.rs
src/compiletest/util.rs
src/liblog/lib.rs
src/librustc/metadata/filesearch.rs
src/librustc/middle/infer/region_inference/graphviz.rs
src/librustc/session/config.rs
src/librustc_back/target/mod.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_trans/save/mod.rs
src/librustdoc/lib.rs
src/libstd/dynamic_lib.rs
src/libstd/env.rs
src/libstd/os.rs
src/libstd/rt/backtrace.rs
src/libstd/rt/util.rs
src/libsyntax/ext/env.rs
src/libterm/terminfo/mod.rs
src/libterm/terminfo/searcher.rs
src/libtest/lib.rs
src/test/run-pass/env-vars.rs