diff options
| author | bors <bors@rust-lang.org> | 2013-05-27 12:38:12 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-27 12:38:12 -0700 |
| commit | b0f3686515410c013f6cd12ce4fc5236e3dee3f2 (patch) | |
| tree | d8c26fa0f1db08519245c29c5c8d9775fa00cf73 /src/libextra | |
| parent | d98cc9995fb5c87230f57eeffb8061df25d85190 (diff) | |
| parent | 8f80323f09ef150efc5cf729100f99981afc96e1 (diff) | |
| download | rust-b0f3686515410c013f6cd12ce4fc5236e3dee3f2.tar.gz rust-b0f3686515410c013f6cd12ce4fc5236e3dee3f2.zip | |
auto merge of #6703 : sanxiyn/rust/allocation-lint, r=sanxiyn
Fix #6145. In particular, handle operator overloading.
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/bitv.rs | 2 | ||||
| -rw-r--r-- | src/libextra/getopts.rs | 18 | ||||
| -rw-r--r-- | src/libextra/json.rs | 16 | ||||
| -rw-r--r-- | src/libextra/md4.rs | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 1262e90518d..8aac20d7a63 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -462,7 +462,7 @@ pub impl Bitv { */ fn to_str(&self) -> ~str { let mut rs = ~""; - for self.each() |i| { if i { rs += ~"1"; } else { rs += ~"0"; } }; + for self.each() |i| { if i { rs += "1"; } else { rs += "0"; } }; rs } diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index 539d18cb0cd..3c223fe05d4 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -193,19 +193,19 @@ pub enum Fail_ { pub fn fail_str(f: Fail_) -> ~str { return match f { ArgumentMissing(ref nm) => { - ~"Argument to option '" + *nm + ~"' missing." + ~"Argument to option '" + *nm + "' missing." } UnrecognizedOption(ref nm) => { - ~"Unrecognized option: '" + *nm + ~"'." + ~"Unrecognized option: '" + *nm + "'." } OptionMissing(ref nm) => { - ~"Required option '" + *nm + ~"' missing." + ~"Required option '" + *nm + "' missing." } OptionDuplicated(ref nm) => { - ~"Option '" + *nm + ~"' given more than once." + ~"Option '" + *nm + "' given more than once." } UnexpectedArgument(ref nm) => { - ~"Option " + *nm + ~" does not take an argument." + ~"Option " + *nm + " does not take an argument." } }; } @@ -618,7 +618,7 @@ pub mod groups { row += match hasarg { No => ~"", Yes => hint, - Maybe => ~"[" + hint + ~"]", + Maybe => ~"[" + hint + "]", }; // FIXME: #5516 @@ -650,10 +650,10 @@ pub mod groups { row }); - return str::to_owned(brief) + - ~"\n\nOptions:\n" + + return str::to_owned(brief) + + "\n\nOptions:\n" + str::connect(rows, "\n") + - ~"\n\n"; + "\n\n"; } } // end groups module diff --git a/src/libextra/json.rs b/src/libextra/json.rs index 5ef0500d53a..adf2c4f35b5 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -47,18 +47,18 @@ fn escape_str(s: &str) -> ~str { let mut escaped = ~"\""; for str::each_char(s) |c| { match c { - '"' => escaped += ~"\\\"", - '\\' => escaped += ~"\\\\", - '\x08' => escaped += ~"\\b", - '\x0c' => escaped += ~"\\f", - '\n' => escaped += ~"\\n", - '\r' => escaped += ~"\\r", - '\t' => escaped += ~"\\t", + '"' => escaped += "\\\"", + '\\' => escaped += "\\\\", + '\x08' => escaped += "\\b", + '\x0c' => escaped += "\\f", + '\n' => escaped += "\\n", + '\r' => escaped += "\\r", + '\t' => escaped += "\\t", _ => escaped += str::from_char(c) } }; - escaped += ~"\""; + escaped += "\""; escaped } diff --git a/src/libextra/md4.rs b/src/libextra/md4.rs index 449774e4cbc..9873d7fcd8e 100644 --- a/src/libextra/md4.rs +++ b/src/libextra/md4.rs @@ -115,7 +115,7 @@ pub fn md4_str(msg: &[u8]) -> ~str { let mut i = 0u32; while i < 4u32 { let byte = (u >> (i * 8u32)) as u8; - if byte <= 16u8 { result += ~"0"; } + if byte <= 16u8 { result += "0"; } result += uint::to_str_radix(byte as uint, 16u); i += 1u32; } |
