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

Stabilize std::convert and related code #23875

Merged
merged 1 commit into from
Apr 1, 2015

Conversation

aturon
Copy link
Member

@aturon aturon commented Mar 30, 2015

  • Marks #[stable] the contents of the std::convert module.
  • Added methods PathBuf::as_path, OsString::as_os_str,
    String::as_str, Vec::{as_slice, as_mut_slice}.
  • Deprecates OsStr::from_str in favor of a new, stable, and more
    general OsStr::new.
  • Adds unstable methods OsString::from_bytes and OsStr::{to_bytes, to_cstring} for ergonomic FFI usage.

[breaking-change]

r? @alexcrichton

reason = "waiting on RFC revision")]
fn as_slice(&self) -> &[T] {
self
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be necessary, right? If we only intend to call this as a method it should be callable through an inherent method on [T]?

@alexcrichton
Copy link
Member

r=me with an unstable as_os_str and as_path function

* Marks `#[stable]` the contents of the `std::convert` module.

* Added methods `PathBuf::as_path`, `OsString::as_os_str`,
  `String::as_str`, `Vec::{as_slice, as_mut_slice}`.

* Deprecates `OsStr::from_str` in favor of a new, stable, and more
  general `OsStr::new`.

* Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes,
  to_cstring}` for ergonomic FFI usage.

[breaking-change]
@alexcrichton
Copy link
Member

@bors: r+ 9fc51ef

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 31, 2015
* Marks `#[stable]` the contents of the `std::convert` module.

* Added methods `PathBuf::as_path`, `OsString::as_os_str`,
  `String::as_str`, `Vec::{as_slice, as_mut_slice}`.

* Deprecates `OsStr::from_str` in favor of a new, stable, and more
  general `OsStr::new`.

* Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes,
  to_cstring}` for ergonomic FFI usage.

[breaking-change]

r? @alexcrichton
@bors bors merged commit 9fc51ef into rust-lang:master Apr 1, 2015
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.

3 participants