Skip to content

std: Generalize generics a bit in std::env #25135

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

Merged
merged 1 commit into from
May 6, 2015

Conversation

alexcrichton
Copy link
Member

Many bounds are currently of the form T: ?Sized + AsRef<OsStr> where the
argument is &T, but the pattern elsewhere (primarily std::fs) has been to
remove the ?Sized bound and take T instead (allowing usage with both
references and owned values). This commit generalizes the possible apis in
std::env from &T to T in this fashion.

The split_paths function remains the same as the return value borrows the
input value, so ta borrowed reference is required.

Many bounds are currently of the form `T: ?Sized + AsRef<OsStr>` where the
argument is `&T`, but the pattern elsewhere (primarily `std::fs`) has been to
remove the `?Sized` bound and take `T` instead (allowing usage with both
references and owned values). This commit generalizes the possible apis in
`std::env` from `&T` to `T` in this fashion.

The `split_paths` function remains the same as the return value borrows the
input value, so ta borrowed reference is required.
@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

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

@aturon
Copy link
Member

aturon commented May 5, 2015

@bors: r+

@bors
Copy link
Collaborator

bors commented May 5, 2015

📌 Commit 9b88cd1 has been approved by aturon

bors added a commit that referenced this pull request May 6, 2015
Many bounds are currently of the form `T: ?Sized + AsRef<OsStr>` where the
argument is `&T`, but the pattern elsewhere (primarily `std::fs`) has been to
remove the `?Sized` bound and take `T` instead (allowing usage with both
references and owned values). This commit generalizes the possible apis in
`std::env` from `&T` to `T` in this fashion.

The `split_paths` function remains the same as the return value borrows the
input value, so ta borrowed reference is required.
@bors
Copy link
Collaborator

bors commented May 6, 2015

⌛ Testing commit 9b88cd1 with merge 0848d1c...

@bors
Copy link
Collaborator

bors commented May 6, 2015

@bors bors merged commit 9b88cd1 into rust-lang:master May 6, 2015
@alexcrichton alexcrichton deleted the generalize-env-set-var branch July 10, 2015 22:32
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