about summary refs log tree commit diff
path: root/src/libgetopts/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-27 20:44:58 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-28 08:35:41 -0700
commit42aed6bde2fb05a262e21334656cdf91f51744dd (patch)
tree0b7c43f70001fe714a13f95df7e2807a8fdfb85b /src/libgetopts/lib.rs
parent24b1ce1daf9dbf66d04116d0549a48a7610bc614 (diff)
downloadrust-42aed6bde2fb05a262e21334656cdf91f51744dd.tar.gz
rust-42aed6bde2fb05a262e21334656cdf91f51744dd.zip
std: Remove format_strbuf!()
This was only ever a transitionary macro.
Diffstat (limited to 'src/libgetopts/lib.rs')
-rw-r--r--src/libgetopts/lib.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs
index c88b825811f..37c3fe0d2ef 100644
--- a/src/libgetopts/lib.rs
+++ b/src/libgetopts/lib.rs
@@ -500,19 +500,19 @@ impl Fail_ {
     pub fn to_err_msg(self) -> String {
         match self {
             ArgumentMissing(ref nm) => {
-                format_strbuf!("Argument to option '{}' missing.", *nm)
+                format!("Argument to option '{}' missing.", *nm)
             }
             UnrecognizedOption(ref nm) => {
-                format_strbuf!("Unrecognized option: '{}'.", *nm)
+                format!("Unrecognized option: '{}'.", *nm)
             }
             OptionMissing(ref nm) => {
-                format_strbuf!("Required option '{}' missing.", *nm)
+                format!("Required option '{}' missing.", *nm)
             }
             OptionDuplicated(ref nm) => {
-                format_strbuf!("Option '{}' given more than once.", *nm)
+                format!("Option '{}' given more than once.", *nm)
             }
             UnexpectedArgument(ref nm) => {
-                format_strbuf!("Option '{}' does not take an argument.", *nm)
+                format!("Option '{}' does not take an argument.", *nm)
             }
         }
     }
@@ -740,9 +740,8 @@ pub fn usage(brief: &str, opts: &[OptGroup]) -> String {
         row
     });
 
-    format_strbuf!("{}\n\nOptions:\n{}\n",
-                   brief,
-                   rows.collect::<Vec<String>>().connect("\n"))
+    format!("{}\n\nOptions:\n{}\n", brief,
+            rows.collect::<Vec<String>>().connect("\n"))
 }
 
 fn format_option(opt: &OptGroup) -> String {
@@ -784,7 +783,7 @@ fn format_option(opt: &OptGroup) -> String {
 
 /// Derive a short one-line usage summary from a set of long options.
 pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
-    let mut line = format_strbuf!("Usage: {} ", program_name);
+    let mut line = format!("Usage: {} ", program_name);
     line.push_str(opts.iter()
                       .map(format_option)
                       .collect::<Vec<String>>()