about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ascii.rs2
-rw-r--r--src/libstd/fmt.rs7
-rw-r--r--src/libstd/io/fs.rs9
-rw-r--r--src/libstd/io/tempfile.rs8
-rw-r--r--src/libstd/io/test.rs10
-rw-r--r--src/libstd/macros.rs8
-rw-r--r--src/libstd/num/int_macros.rs2
-rw-r--r--src/libstd/num/uint_macros.rs2
-rw-r--r--src/libstd/os.rs4
-rw-r--r--src/libstd/path/windows.rs2
-rw-r--r--src/libstd/rt/unwind.rs2
-rw-r--r--src/libstd/str.rs4
-rw-r--r--src/libstd/to_str.rs2
13 files changed, 23 insertions, 39 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs
index 55bbf4ddf75..75b31f9c354 100644
--- a/src/libstd/ascii.rs
+++ b/src/libstd/ascii.rs
@@ -783,6 +783,6 @@ mod tests {
     #[test]
     fn test_show() {
         let c = Ascii { chr: 't' as u8 };
-        assert_eq!(format_strbuf!("{}", c), "t".to_string());
+        assert_eq!(format!("{}", c), "t".to_string());
     }
 }
diff --git a/src/libstd/fmt.rs b/src/libstd/fmt.rs
index d53a0f93c9b..9bca2f4248c 100644
--- a/src/libstd/fmt.rs
+++ b/src/libstd/fmt.rs
@@ -562,13 +562,6 @@ pub fn format(args: &Arguments) -> string::String{
     str::from_utf8(output.unwrap().as_slice()).unwrap().into_string()
 }
 
-/// Temporary transition utility
-pub fn format_strbuf(args: &Arguments) -> string::String {
-    let mut output = io::MemWriter::new();
-    let _ = write!(&mut output, "{}", args);
-    str::from_utf8(output.unwrap().as_slice()).unwrap().into_string()
-}
-
 #[cfg(stage0)]
 impl<T> Poly for T {
     fn fmt(&self, f: &mut Formatter) -> Result {
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index d3e250be9a3..a77c7107f28 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -745,8 +745,7 @@ mod test {
     pub fn tmpdir() -> TempDir {
         use os;
         use rand;
-        let ret = os::tmpdir().join(
-            format_strbuf!("rust-{}", rand::random::<u32>()));
+        let ret = os::tmpdir().join(format!("rust-{}", rand::random::<u32>()));
         check!(io::fs::mkdir(&ret, io::UserRWX));
         TempDir(ret)
     }
@@ -953,7 +952,7 @@ mod test {
         check!(mkdir(dir, io::UserRWX));
         let prefix = "foo";
         for n in range(0,3) {
-            let f = dir.join(format_strbuf!("{}.txt", n));
+            let f = dir.join(format!("{}.txt", n));
             let mut w = check!(File::create(&f));
             let msg_str = format!("{}{}", prefix, n.to_str());
             let msg = msg_str.as_slice().as_bytes();
@@ -1040,7 +1039,7 @@ mod test {
         let tmpdir = tmpdir();
 
         let mut dirpath = tmpdir.path().clone();
-        dirpath.push(format_strbuf!("test-가一ー你好"));
+        dirpath.push(format!("test-가一ー你好"));
         check!(mkdir(&dirpath, io::UserRWX));
         assert!(dirpath.is_dir());
 
@@ -1057,7 +1056,7 @@ mod test {
 
         let tmpdir = tmpdir();
         let unicode = tmpdir.path();
-        let unicode = unicode.join(format_strbuf!("test-각丁ー再见"));
+        let unicode = unicode.join(format!("test-각丁ー再见"));
         check!(mkdir(&unicode, io::UserRWX));
         assert!(unicode.exists());
         assert!(!Path::new("test/unicode-bogus-path-각丁ー再见").exists());
diff --git a/src/libstd/io/tempfile.rs b/src/libstd/io/tempfile.rs
index 806df838c91..5ca7e417af6 100644
--- a/src/libstd/io/tempfile.rs
+++ b/src/libstd/io/tempfile.rs
@@ -43,10 +43,10 @@ impl TempDir {
 
         for _ in range(0u, 1000) {
             let filename =
-                format_strbuf!("rs-{}-{}-{}",
-                               unsafe { libc::getpid() },
-                               unsafe { CNT.fetch_add(1, atomics::SeqCst) },
-                               suffix);
+                format!("rs-{}-{}-{}",
+                        unsafe { libc::getpid() },
+                        unsafe { CNT.fetch_add(1, atomics::SeqCst) },
+                        suffix);
             let p = tmpdir.join(filename);
             match fs::mkdir(&p, io::UserRWX) {
                 Err(..) => {}
diff --git a/src/libstd/io/test.rs b/src/libstd/io/test.rs
index bc52bc9946c..4d3dde46b57 100644
--- a/src/libstd/io/test.rs
+++ b/src/libstd/io/test.rs
@@ -67,14 +67,14 @@ pub fn next_test_unix() -> Path {
     // base port and pid are an attempt to be unique between multiple
     // test-runners of different configurations running on one
     // buildbot, the count is to be unique within this executable.
-    let string = format_strbuf!("rust-test-unix-path-{}-{}-{}",
-                                base_port(),
-                                unsafe {libc::getpid()},
-                                unsafe {COUNT.fetch_add(1, Relaxed)});
+    let string = format!("rust-test-unix-path-{}-{}-{}",
+                         base_port(),
+                         unsafe {libc::getpid()},
+                         unsafe {COUNT.fetch_add(1, Relaxed)});
     if cfg!(unix) {
         os::tmpdir().join(string)
     } else {
-        Path::new(format_strbuf!("{}{}", r"\\.\pipe\", string))
+        Path::new(format!("{}{}", r"\\.\pipe\", string))
     }
 }
 
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index 28b4552fd4c..0b9fc250636 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -229,14 +229,6 @@ macro_rules! format(
     )
 )
 
-/// Temporary transitionary thing.
-#[macro_export]
-macro_rules! format_strbuf(
-    ($($arg:tt)*) => (
-        format_args!(::std::fmt::format_strbuf, $($arg)*)
-    )
-)
-
 /// Use the `format!` syntax to write data into a buffer of type `&mut Writer`.
 /// See `std::fmt` for more information.
 ///
diff --git a/src/libstd/num/int_macros.rs b/src/libstd/num/int_macros.rs
index 7ed00e3dd9d..889a42ec00e 100644
--- a/src/libstd/num/int_macros.rs
+++ b/src/libstd/num/int_macros.rs
@@ -78,7 +78,7 @@ impl ToStrRadix for $T {
     /// Convert to a string in a given base.
     #[inline]
     fn to_str_radix(&self, radix: uint) -> String {
-        format_strbuf!("{}", ::fmt::radix(*self, radix as u8))
+        format!("{}", ::fmt::radix(*self, radix as u8))
     }
 }
 
diff --git a/src/libstd/num/uint_macros.rs b/src/libstd/num/uint_macros.rs
index 43048453717..769588d0bcb 100644
--- a/src/libstd/num/uint_macros.rs
+++ b/src/libstd/num/uint_macros.rs
@@ -79,7 +79,7 @@ impl ToStrRadix for $T {
     /// Convert to a string in a given base.
     #[inline]
     fn to_str_radix(&self, radix: uint) -> String {
-        format_strbuf!("{}", ::fmt::radix(*self, radix as u8))
+        format!("{}", ::fmt::radix(*self, radix as u8))
     }
 }
 
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 7d3758d621d..f960228c63c 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -437,7 +437,7 @@ pub fn pipe() -> Pipe {
 
 /// Returns the proper dll filename for the given basename of a file.
 pub fn dll_filename(base: &str) -> String {
-    format_strbuf!("{}{}{}", consts::DLL_PREFIX, base, consts::DLL_SUFFIX)
+    format!("{}{}{}", consts::DLL_PREFIX, base, consts::DLL_SUFFIX)
 }
 
 /// Optionally returns the filesystem path of the current executable which is
@@ -1513,7 +1513,7 @@ mod tests {
 
     fn make_rand_name() -> String {
         let mut rng = rand::task_rng();
-        let n = format_strbuf!("TEST{}", rng.gen_ascii_str(10u).as_slice());
+        let n = format!("TEST{}", rng.gen_ascii_str(10u).as_slice());
         assert!(getenv(n.as_slice()).is_none());
         n
     }
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 1fc2fa1d221..88c3e9def8c 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -900,7 +900,7 @@ pub fn make_non_verbatim(path: &Path) -> Option<Path> {
         }
         Some(VerbatimUNCPrefix(_,_)) => {
             // \\?\UNC\server\share
-            Path::new(format_strbuf!(r"\\{}", repr.slice_from(7)))
+            Path::new(format!(r"\\{}", repr.slice_from(7)))
         }
     };
     if new_path.prefix.is_none() {
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs
index be05bfceaac..f34dcaaa427 100644
--- a/src/libstd/rt/unwind.rs
+++ b/src/libstd/rt/unwind.rs
@@ -354,7 +354,7 @@ pub fn begin_unwind_fmt(msg: &fmt::Arguments, file: &'static str,
     // required with the current scheme, and (b) we don't handle
     // failure + OOM properly anyway (see comment in begin_unwind
     // below).
-    begin_unwind_inner(box fmt::format_strbuf(msg), file, line)
+    begin_unwind_inner(box fmt::format(msg), file, line)
 }
 
 /// This is the entry point of unwinding for fail!() and assert!().
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index 9e15612c72b..b80b2581e08 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -2123,7 +2123,7 @@ mod tests {
         assert_eq!(s.len(), 5);
         assert_eq!(s.as_slice(), "abcde");
         assert_eq!(s.to_str(), "abcde".to_string());
-        assert_eq!(format_strbuf!("{}", s), "abcde".to_string());
+        assert_eq!(format!("{}", s), "abcde".to_string());
         assert!(s.lt(&Owned("bcdef".to_string())));
         assert_eq!(Slice(""), Default::default());
 
@@ -2131,7 +2131,7 @@ mod tests {
         assert_eq!(o.len(), 5);
         assert_eq!(o.as_slice(), "abcde");
         assert_eq!(o.to_str(), "abcde".to_string());
-        assert_eq!(format_strbuf!("{}", o), "abcde".to_string());
+        assert_eq!(format!("{}", o), "abcde".to_string());
         assert!(o.lt(&Slice("bcdef")));
         assert_eq!(Owned("".to_string()), Default::default());
 
diff --git a/src/libstd/to_str.rs b/src/libstd/to_str.rs
index c2100111e12..3b223b68ee6 100644
--- a/src/libstd/to_str.rs
+++ b/src/libstd/to_str.rs
@@ -31,7 +31,7 @@ pub trait IntoStr {
 
 impl<T: fmt::Show> ToStr for T {
     fn to_str(&self) -> String {
-        format_strbuf!("{}", *self)
+        format!("{}", *self)
     }
 }