about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-02 10:46:05 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-03-05 14:57:01 -0800
commit628f5d29c3b93bbd590e08dc2c69f842a18d1231 (patch)
treead05df7b6bcbbc9b26eb5eb243626014add1cedb /src/libstd/path.rs
parent68740b405404a3f885e388c8d31722797d519c30 (diff)
downloadrust-628f5d29c3b93bbd590e08dc2c69f842a18d1231.tar.gz
rust-628f5d29c3b93bbd590e08dc2c69f842a18d1231.zip
std: Stabilize the `ffi` module
The two main sub-modules, `c_str` and `os_str`, have now had some time to bake
in the standard library. This commits performs a sweep over the modules adding
various stability tags.

The following APIs are now marked `#[stable]`

* `OsString`
* `OsStr`
* `OsString::from_string`
* `OsString::from_str`
* `OsString::new`
* `OsString::into_string`
* `OsString::push` (renamed from `push_os_str`, added an `AsOsStr` bound)
* various trait implementations for `OsString`
* `OsStr::from_str`
* `OsStr::to_str`
* `OsStr::to_string_lossy`
* `OsStr::to_os_string`
* various trait implementations for `OsStr`
* `CString`
* `CStr`
* `NulError`
* `CString::new` - this API's implementation may change as a result of
  rust-lang/rfcs#912 but the usage of `CString::new(thing)` looks like it is
  unlikely to change. Additionally, the `IntoBytes` bound is also likely to
  change but the set of implementors for the trait will not change (despite the
  trait perhaps being renamed).
* `CString::from_vec_unchecked`
* `CString::as_bytes`
* `CString::as_bytes_with_nul`
* `NulError::nul_position`
* `NulError::into_vec`
* `CStr::from_ptr`
* `CStr::as_ptr`
* `CStr::to_bytes`
* `CStr::to_bytes_with_nul`
* various trait implementations for `CStr`

The following APIs remain `#[unstable]`

* `OsStr*Ext` traits remain unstable as the organization of `os::platform` is
  uncertain still and the traits may change location.
* `AsOsStr` remains unstable as generic conversion traits are likely to be
  rethought soon.

The following APIs were deprecated

* `OsString::push_os_str` is now called `push` and takes `T: AsOsStr` instead (a
  superset of the previous functionality).
Diffstat (limited to 'src/libstd/path.rs')
-rwxr-xr-xsrc/libstd/path.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index b85a0dcec81..18720ecddd9 100755
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -872,10 +872,10 @@ impl PathBuf {
 
         // `path` is a pure relative path
         } else if need_sep {
-            self.inner.push_os_str(OsStr::from_str(MAIN_SEP_STR));
+            self.inner.push(MAIN_SEP_STR);
         }
 
-        self.inner.push_os_str(path.as_os_str());
+        self.inner.push(path);
     }
 
     /// Truncate `self` to `self.parent()`.
@@ -937,8 +937,8 @@ impl PathBuf {
 
         let extension = extension.as_os_str();
         if os_str_as_u8_slice(extension).len() > 0 {
-            stem.push_os_str(OsStr::from_str("."));
-            stem.push_os_str(extension.as_os_str());
+            stem.push(".");
+            stem.push(extension);
         }
         self.set_file_name(&stem);