Skip to content

Commit 732e057

Browse files
committed
auto merge of #14667 : aochagavia/rust/pr2, r=huonw
2 parents 100ff4c + 501b904 commit 732e057

File tree

31 files changed

+54
-51
lines changed

31 files changed

+54
-51
lines changed

src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
3131
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
3232
re.captures(line).and_then(|caps| {
3333
let adjusts = caps.name("adjusts").len();
34-
let kind = caps.name("kind").to_ascii().to_lower().into_str().to_string();
34+
let kind = caps.name("kind").to_ascii().to_lower().into_str();
3535
let msg = caps.name("msg").trim().to_string();
3636

3737
debug!("line={} kind={} msg={}", line_num, kind, msg);

src/compiletest/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn make_new_path(path: &str) -> String {
4141
Some(curr) => {
4242
format!("{}{}{}", path, path_div(), curr)
4343
}
44-
None => path.to_str().to_string()
44+
None => path.to_str()
4545
}
4646
}
4747

src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Use [`ToStr`](std/to_str/trait.ToStr.html).
88

99
~~~
1010
let x: int = 42;
11-
let y: String = x.to_str().to_string();
11+
let y: String = x.to_str();
1212
~~~
1313

1414
**String to int**

src/doc/guide-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ fn stringifier(channel: &sync::DuplexStream<String, uint>) {
467467
let mut value: uint;
468468
loop {
469469
value = channel.recv();
470-
channel.send(value.to_str().to_string());
470+
channel.send(value.to_str());
471471
if value == 0 { break; }
472472
}
473473
}
@@ -492,7 +492,7 @@ extern crate sync;
492492
# let mut value: uint;
493493
# loop {
494494
# value = channel.recv();
495-
# channel.send(value.to_str().to_string());
495+
# channel.send(value.to_str());
496496
# if value == 0u { break; }
497497
# }
498498
# }

src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3579,7 +3579,7 @@ trait Printable {
35793579
}
35803580
35813581
impl Printable for int {
3582-
fn to_string(&self) -> String { self.to_str().to_string() }
3582+
fn to_string(&self) -> String { self.to_str() }
35833583
}
35843584
35853585
fn print(a: Box<Printable>) {

src/libgetopts/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl Name {
222222

223223
fn to_str(&self) -> String {
224224
match *self {
225-
Short(ch) => ch.to_str().to_string(),
225+
Short(ch) => ch.to_str(),
226226
Long(ref s) => s.to_string()
227227
}
228228
}

src/libnum/complex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ mod test {
349349
#[test]
350350
fn test_to_str() {
351351
fn test(c : Complex64, s: String) {
352-
assert_eq!(c.to_str().to_string(), s);
352+
assert_eq!(c.to_str(), s);
353353
}
354354
test(_0_0i, "0+0i".to_string());
355355
test(_1_0i, "1+0i".to_string());

src/libnum/rational.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ mod test {
559559
fn test_to_from_str() {
560560
fn test(r: Rational, s: String) {
561561
assert_eq!(FromStr::from_str(s.as_slice()), Some(r));
562-
assert_eq!(r.to_str().to_string(), s);
562+
assert_eq!(r.to_str(), s);
563563
}
564564
test(_1, "1/1".to_string());
565565
test(_0, "0/1".to_string());

src/libregex_macros/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ fn parse(cx: &mut ExtCtxt, tts: &[ast::TokenTree]) -> Option<String> {
620620
let regex = match entry.node {
621621
ast::ExprLit(lit) => {
622622
match lit.node {
623-
ast::LitStr(ref s, _) => s.to_str().to_string(),
623+
ast::LitStr(ref s, _) => s.to_str(),
624624
_ => {
625625
cx.span_err(entry.span, format!(
626626
"expected string literal but got `{}`",

src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,15 +533,15 @@ impl pprust::PpAnn for IdentifiedAnnotation {
533533
match node {
534534
pprust::NodeItem(item) => {
535535
try!(pp::space(&mut s.s));
536-
s.synth_comment(item.id.to_str().to_string())
536+
s.synth_comment(item.id.to_str())
537537
}
538538
pprust::NodeBlock(blk) => {
539539
try!(pp::space(&mut s.s));
540540
s.synth_comment((format!("block {}", blk.id)).to_string())
541541
}
542542
pprust::NodeExpr(expr) => {
543543
try!(pp::space(&mut s.s));
544-
try!(s.synth_comment(expr.id.to_str().to_string()));
544+
try!(s.synth_comment(expr.id.to_str()));
545545
s.pclose()
546546
}
547547
pprust::NodePat(pat) => {

0 commit comments

Comments
 (0)