Skip to content

Commit ccd0ac5

Browse files
committed
std: remove str::{connect,concat}*.
1 parent 5a711ea commit ccd0ac5

38 files changed

+62
-86
lines changed

src/compiletest/runtest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
244244
None => copy *config
245245
};
246246
let config = &mut config;
247-
let cmds = str::connect(props.debugger_cmds, "\n");
247+
let cmds = props.debugger_cmds.connect("\n");
248248
let check_lines = copy props.check_lines;
249249

250250
// compile test file (it shoud have 'compile-flags:-g' in the header)
@@ -645,13 +645,13 @@ fn program_output(config: &config, testfile: &Path, lib_path: &str, prog: ~str,
645645
#[cfg(target_os = "macos")]
646646
#[cfg(target_os = "freebsd")]
647647
fn make_cmdline(_libpath: &str, prog: &str, args: &[~str]) -> ~str {
648-
fmt!("%s %s", prog, str::connect(args, " "))
648+
fmt!("%s %s", prog, args.connect(" "))
649649
}
650650

651651
#[cfg(target_os = "win32")]
652652
fn make_cmdline(libpath: &str, prog: &str, args: &[~str]) -> ~str {
653653
fmt!("%s %s %s", lib_path_cmd_prefix(libpath), prog,
654-
str::connect(args, " "))
654+
args.connect(" "))
655655
}
656656

657657
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line

src/libextra/getopts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,14 +648,14 @@ pub mod groups {
648648

649649
// FIXME: #5516
650650
// wrapped description
651-
row += str::connect(desc_rows, desc_sep);
651+
row += desc_rows.connect(desc_sep);
652652

653653
row
654654
});
655655

656656
return str::to_owned(brief) +
657657
"\n\nOptions:\n" +
658-
str::connect(rows, "\n") +
658+
rows.connect("\n") +
659659
"\n\n";
660660
}
661661
} // end groups module

src/libextra/net_url.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ pub fn query_to_str(query: &Query) -> ~str {
354354
}
355355
}
356356
}
357-
return str::connect(strvec, "&");
357+
return strvec.connect("&");
358358
}
359359

360360
// returns the scheme and the rest of the url, or a parsing error

src/libextra/num/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,10 @@ impl ToStrRadix for BigUint {
520520

521521
fn fill_concat(v: &[BigDigit], radix: uint, l: uint) -> ~str {
522522
if v.is_empty() { return ~"0" }
523-
let s = str::concat(vec::reversed(v).map(|n| {
523+
let s = vec::reversed(v).map(|n| {
524524
let s = uint::to_str_radix(*n as uint, radix);
525525
str::from_chars(vec::from_elem(l - s.len(), '0')) + s
526-
}));
526+
}).concat();
527527
s.trim_left_chars(['0']).to_owned()
528528
}
529529
}

src/libextra/semver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ impl ToStr for Version {
8181
let s = if self.pre.is_empty() {
8282
s
8383
} else {
84-
s + "-" + str::connect(self.pre.map(|i| i.to_str()), ".")
84+
s + "-" + self.pre.map(|i| i.to_str()).connect(".")
8585
};
8686
if self.build.is_empty() {
8787
s
8888
} else {
89-
s + "+" + str::connect(self.build.map(|i| i.to_str()), ".")
89+
s + "+" + self.build.map(|i| i.to_str()).connect(".")
9090
}
9191
}
9292
}

src/librustc/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ pub mod write {
394394
sess.err(fmt!("building with `%s` failed with code %d",
395395
cc_prog, prog.status));
396396
sess.note(fmt!("%s arguments: %s",
397-
cc_prog, str::connect(cc_args, " ")));
397+
cc_prog, cc_args.connect(" ")));
398398
sess.note(str::from_bytes(prog.error + prog.output));
399399
sess.abort_if_errors();
400400
}
@@ -809,14 +809,14 @@ pub fn link_binary(sess: Session,
809809

810810
debug!("output: %s", output.to_str());
811811
let cc_args = link_args(sess, obj_filename, out_filename, lm);
812-
debug!("%s link args: %s", cc_prog, str::connect(cc_args, " "));
812+
debug!("%s link args: %s", cc_prog, cc_args.connect(" "));
813813
// We run 'cc' here
814814
let prog = run::process_output(cc_prog, cc_args);
815815
if 0 != prog.status {
816816
sess.err(fmt!("linking with `%s` failed with code %d",
817817
cc_prog, prog.status));
818818
sess.note(fmt!("%s arguments: %s",
819-
cc_prog, str::connect(cc_args, " ")));
819+
cc_prog, cc_args.connect(" ")));
820820
sess.note(str::from_bytes(prog.error + prog.output));
821821
sess.abort_if_errors();
822822
}

src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ pub fn compile_rest(sess: Session,
328328

329329
let outputs = outputs.get_ref();
330330
if (sess.opts.debugging_opts & session::print_link_args) != 0 {
331-
io::println(str::connect(link::link_args(sess,
332-
&outputs.obj_filename, &outputs.out_filename, link_meta), " "));
331+
io::println(link::link_args(sess, &outputs.obj_filename,
332+
&outputs.out_filename, link_meta).connect(" "));
333333
}
334334

335335
// NB: Android hack

src/librustc/middle/trans/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
8787
revoke_clean(bcx, *c);
8888
}
8989

90-
let mut constraints = str::connect(constraints, ",");
90+
let mut constraints = constraints.connect(",");
9191

9292
let mut clobbers = getClobbers();
9393
if *ia.clobbers != ~"" && clobbers != ~"" {

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ pub fn trans_enum_variant(ccx: @CrateContext,
19951995

19961996
debug!("trans_enum_variant: name=%s tps=%s repr=%? enum_ty=%s",
19971997
unsafe { str::raw::from_c_str(llvm::LLVMGetValueName(llfndecl)) },
1998-
~"[" + str::connect(ty_param_substs.map(|&t| ty_to_str(ccx.tcx, t)), ", ") + "]",
1998+
~"[" + ty_param_substs.map(|&t| ty_to_str(ccx.tcx.connect(t)), ", ") + "]",
19991999
repr, ty_to_str(ccx.tcx, enum_ty));
20002000
20012001
adt::trans_start_init(bcx, repr, fcx.llretptr.get(), disr);

src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub fn Invoke(cx: block,
192192
terminate(cx, "Invoke");
193193
debug!("Invoke(%s with arguments (%s))",
194194
val_str(cx.ccx().tn, Fn),
195-
str::connect(vec::map(Args, |a| val_str(cx.ccx().tn,
195+
vec::map(Args.connect(|a| val_str(cx.ccx().tn,
196196
*a).to_owned()),
197197
", "));
198198
unsafe {

0 commit comments

Comments
 (0)