about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2013-05-29 20:10:16 +0200
committerBjörn Steinbrink <bsteinbr@gmail.com>2013-05-30 11:49:04 +0200
commit1720d9f663c07422b91cbb5fc857b625d120155c (patch)
tree8d765b5e139ce63eab13d3d838903a7cf577ba70 /src/libstd
parentca74cbdc5cc7747e429a985b7b5fb5c4e4a5d4d5 (diff)
downloadrust-1720d9f663c07422b91cbb5fc857b625d120155c.tar.gz
rust-1720d9f663c07422b91cbb5fc857b625d120155c.zip
Remove a bunch of unnecessary allocations and copies
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/os.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index cc36dcb92a2..446804f7b30 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -145,7 +145,7 @@ pub mod win32 {
     pub fn as_utf16_p<T>(s: &str, f: &fn(*u16) -> T) -> T {
         let mut t = str::to_utf16(s);
         // Null terminate before passing on.
-        t += ~[0u16];
+        t += [0u16];
         vec::as_imm_buf(t, |buf, _len| f(buf))
     }
 }
@@ -437,8 +437,7 @@ fn dup2(src: c_int, dst: c_int) -> c_int {
 
 /// Returns the proper dll filename for the given basename of a file.
 pub fn dll_filename(base: &str) -> ~str {
-    return str::to_owned(DLL_PREFIX) + str::to_owned(base) +
-           str::to_owned(DLL_SUFFIX)
+    fmt!("%s%s%s", DLL_PREFIX, base, DLL_SUFFIX)
 }
 
 /// Optionally returns the filesystem path to the current executable which is