diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-27 20:44:58 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-28 08:35:41 -0700 |
| commit | 42aed6bde2fb05a262e21334656cdf91f51744dd (patch) | |
| tree | 0b7c43f70001fe714a13f95df7e2807a8fdfb85b /src/libgetopts/lib.rs | |
| parent | 24b1ce1daf9dbf66d04116d0549a48a7610bc614 (diff) | |
| download | rust-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.rs | 17 |
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>>() |
