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 PathBuf capacity methods #71328

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,6 @@ impl PathBuf {
/// # Examples
///
/// ```
/// #![feature(path_buf_capacity)]
/// use std::path::PathBuf;
///
/// let mut path = PathBuf::with_capacity(10);
Expand All @@ -1130,7 +1129,7 @@ impl PathBuf {
///
/// [`with_capacity`]: ../ffi/struct.OsString.html#method.with_capacity
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
pub fn with_capacity(capacity: usize) -> PathBuf {
PathBuf { inner: OsString::with_capacity(capacity) }
}
Expand Down Expand Up @@ -1374,7 +1373,7 @@ impl PathBuf {
///
/// [`capacity`]: ../ffi/struct.OsString.html#method.capacity
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
pub fn capacity(&self) -> usize {
self.inner.capacity()
}
Expand All @@ -1383,7 +1382,7 @@ impl PathBuf {
///
/// [`clear`]: ../ffi/struct.OsString.html#method.clear
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
pub fn clear(&mut self) {
self.inner.clear()
}
Expand All @@ -1392,7 +1391,7 @@ impl PathBuf {
///
/// [`reserve`]: ../ffi/struct.OsString.html#method.reserve
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
pub fn reserve(&mut self, additional: usize) {
self.inner.reserve(additional)
}
Expand All @@ -1401,7 +1400,7 @@ impl PathBuf {
///
/// [`reserve_exact`]: ../ffi/struct.OsString.html#method.reserve_exact
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
pub fn reserve_exact(&mut self, additional: usize) {
self.inner.reserve_exact(additional)
}
Expand All @@ -1410,7 +1409,7 @@ impl PathBuf {
///
/// [`shrink_to_fit`]: ../ffi/struct.OsString.html#method.shrink_to_fit
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[stable(feature = "path_buf_capacity", since = "1.44.0")]
pub fn shrink_to_fit(&mut self) {
self.inner.shrink_to_fit()
}
Expand All @@ -1419,7 +1418,7 @@ impl PathBuf {
///
/// [`shrink_to`]: ../ffi/struct.OsString.html#method.shrink_to
/// [`OsString`]: ../ffi/struct.OsString.html
#[unstable(feature = "path_buf_capacity", issue = "58234")]
#[unstable(feature = "shrink_to", issue = "56431")]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.inner.shrink_to(min_capacity)
}
Expand Down