about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Stillwell <aaron@stillwell.tech>2019-02-17 16:41:05 +0000
committerAaron Stillwell <aaron@stillwell.tech>2019-02-17 16:41:05 +0000
commitdbf60d9ca1db6fb1ae296f25af02b27b8264577d (patch)
tree6c66d0098bbc4998899fc03092e8c98e6dc680c4
parenta23c40ec9435dd7b784e833e876a133c627aff92 (diff)
downloadrust-dbf60d9ca1db6fb1ae296f25af02b27b8264577d.tar.gz
rust-dbf60d9ca1db6fb1ae296f25af02b27b8264577d.zip
Fixes for implementation of PathBuf methods (aliases for OsString)
- Fixed incorrect `mut` usage
- Fixed style in accordance with tidy
- Marked all methods as unstable
- Changed feature identifier to path_buf_alias_os_string_methods
-rw-r--r--src/libstd/path.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 3e794956550..0761b1d0a8f 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1137,7 +1137,7 @@ impl PathBuf {
     ///
     /// ```
     /// use std::path::PathBuf;
-    /// 
+    ///
     /// let path = PathBuf::new();
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -1145,26 +1145,26 @@ impl PathBuf {
         PathBuf { inner: OsString::new() }
     }
 
-    /// Creates a new `PathBuf` with a given capacity used to create the 
+    /// Creates a new `PathBuf` with a given capacity used to create the
     /// internal [`OsString`]. See [`with_capacity`] defined on [`OsString`].
     ///
     /// # Examples
-    /// 
+    ///
     /// ```
     /// use std::path::PathBuf;
-    /// 
+    ///
     /// let path = PathBuf::with_capacity(10);
     /// let capacity = path.capacity();
-    /// 
+    ///
     /// // This push is done without reallocating
     /// path.push(r"C:\");
     ///
     /// assert_eq!(capacity, path.capacity());
     /// ```
-    /// 
+    ///
     /// [`with_capacity`]: ../ffi/struct.OsString.html#method.with_capacity
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
     pub fn with_capacity(capacity: usize) -> PathBuf {
         PathBuf {
             inner: OsString::with_capacity(capacity)
@@ -1404,8 +1404,8 @@ impl PathBuf {
     ///
     /// [`capacity`]: ../ffi/struct.OsString.html#method.capacity
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
-    pub fn capacity(self) -> usize {
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
+    pub fn capacity(&self) -> usize {
         self.inner.capacity()
     }
 
@@ -1413,8 +1413,8 @@ impl PathBuf {
     ///
     /// [`clear`]: ../ffi/struct.OsString.html#method.clear
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
-    pub fn clear(mut self) {
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
+    pub fn clear(&mut self) {
         self.inner.clear()
     }
 
@@ -1422,8 +1422,8 @@ impl PathBuf {
     ///
     /// [`reserve`]: ../ffi/struct.OsString.html#method.reserve
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
-    pub fn reserve(mut self, additional: usize) {
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
+    pub fn reserve(&mut self, additional: usize) {
         self.inner.reserve(additional)
     }
 
@@ -1431,8 +1431,8 @@ impl PathBuf {
     ///
     /// [`reserve_exact`]: ../ffi/struct.OsString.html#method.reserve_exact
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
-    pub fn reserve_exact(mut self, additional: usize) {
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
+    pub fn reserve_exact(&mut self, additional: usize) {
         self.inner.reserve_exact(additional)
     }
 
@@ -1440,8 +1440,8 @@ impl PathBuf {
     ///
     /// [`shrink_to_fit`]: ../ffi/struct.OsString.html#method.shrink_to_fit
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
-    pub fn shrink_to_fit(mut self) {
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
+    pub fn shrink_to_fit(&mut self) {
         self.inner.shrink_to_fit()
     }
 
@@ -1449,8 +1449,8 @@ impl PathBuf {
     ///
     /// [`shrink_to`]: ../ffi/struct.OsString.html#method.shrink_to
     /// [`OsString`]: ../ffi/struct.OsString.html
-    #[stable(feature = "path_buf_os_string_methods", since = "1.33.0")]
-    pub fn shrink_to(mut self, min_capacity: usize) {
+    #[unstable(feature = "path_buf_alias_os_string_methods", issue = "58234")]
+    pub fn shrink_to(&mut self, min_capacity: usize) {
         self.inner.shrink_to(min_capacity)
     }
 }