Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Tweak the std::env OsString/String interface #22188

Merged
merged 1 commit into from
Feb 12, 2015

Conversation

alexcrichton
Copy link
Member

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]

@alexcrichton
Copy link
Member Author

cc #21787, @John-Nagle

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned nikomatsakis Feb 11, 2015
@aturon
Copy link
Member

aturon commented Feb 11, 2015

@bors: r+ 1716d02

@alexcrichton
Copy link
Member Author

@bors: r=aturon a828e79

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]
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 11, 2015
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]
@bors bors merged commit a828e79 into rust-lang:master Feb 12, 2015
@alexcrichton alexcrichton deleted the envv2 branch February 12, 2015 02:54
@aturon aturon mentioned this pull request Feb 18, 2015
91 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants