]> git.lizzy.rs Git - rust.git/commitdiff
std: remove str::{connect,concat}*.
authorHuon Wilson <dbau.pp+github@gmail.com>
Mon, 10 Jun 2013 13:25:25 +0000 (23:25 +1000)
committerHuon Wilson <dbau.pp+github@gmail.com>
Mon, 10 Jun 2013 13:57:03 +0000 (23:57 +1000)
38 files changed:
src/compiletest/runtest.rs
src/libextra/getopts.rs
src/libextra/net_url.rs
src/libextra/num/bigint.rs
src/libextra/semver.rs
src/librustc/back/link.rs
src/librustc/driver/driver.rs
src/librustc/middle/trans/asm.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/build.rs
src/librustc/middle/trans/common.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/infer/test.rs
src/librustc/middle/typeck/infer/to_str.rs
src/librustc/util/common.rs
src/librustc/util/ppaux.rs
src/librustdoc/attr_parser.rs
src/librustdoc/markdown_pass.rs
src/librustdoc/markdown_writer.rs
src/librustdoc/unindent_pass.rs
src/librusti/rusti.rc
src/librustpkg/util.rs
src/libstd/path.rs
src/libstd/str.rs
src/libsyntax/abi.rs
src/libsyntax/ast_map.rs
src/libsyntax/ast_util.rs
src/libsyntax/ext/asm.rs
src/libsyntax/ext/pipes/liveness.rs
src/libsyntax/ext/pipes/pipec.rs
src/libsyntax/ext/quote.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/macro_parser.rs
src/libsyntax/parse/comments.rs
src/libsyntax/parse/parser.rs
src/test/run-pass/issue-3563-3.rs
src/test/run-pass/issue-4241.rs
src/test/run-pass/trait-to-str.rs

index c9e44a79160349940c74716f98cba727eca34671..16190f69549cd31757d7001e1dbc10b4b7a885f5 100644 (file)
@@ -244,7 +244,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
         None => copy *config
     };
     let config = &mut config;
-    let cmds = str::connect(props.debugger_cmds, "\n");
+    let cmds = props.debugger_cmds.connect("\n");
     let check_lines = copy props.check_lines;
 
     // 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,
 #[cfg(target_os = "macos")]
 #[cfg(target_os = "freebsd")]
 fn make_cmdline(_libpath: &str, prog: &str, args: &[~str]) -> ~str {
-    fmt!("%s %s", prog, str::connect(args, " "))
+    fmt!("%s %s", prog, args.connect(" "))
 }
 
 #[cfg(target_os = "win32")]
 fn make_cmdline(libpath: &str, prog: &str, args: &[~str]) -> ~str {
     fmt!("%s %s %s", lib_path_cmd_prefix(libpath), prog,
-         str::connect(args, " "))
+         args.connect(" "))
 }
 
 // Build the LD_LIBRARY_PATH variable as it would be seen on the command line
index 76e921f02f9e6185e160aafee6a0089018ccdd9f..44b56590083550ead5e0db4c7926d2dc1ecbd444 100644 (file)
@@ -648,14 +648,14 @@ pub fn usage(brief: &str, opts: &[OptGroup]) -> ~str {
 
             // FIXME: #5516
             // wrapped description
-            row += str::connect(desc_rows, desc_sep);
+            row += desc_rows.connect(desc_sep);
 
             row
         });
 
         return str::to_owned(brief) +
                "\n\nOptions:\n" +
-               str::connect(rows, "\n") +
+               rows.connect("\n") +
                "\n\n";
     }
 } // end groups module
index 30d55721efb76dec9dd7446ae803c3a04c7e1649..46e76a7a39913f74e5342e3d482740accd9925bd 100644 (file)
@@ -354,7 +354,7 @@ pub fn query_to_str(query: &Query) -> ~str {
             }
         }
     }
-    return str::connect(strvec, "&");
+    return strvec.connect("&");
 }
 
 // returns the scheme and the rest of the url, or a parsing error
index 0294b595cfd93e6f16197ac8f53b68067addb8b2..c6e7592a314e13c707bccd027573381032628203 100644 (file)
@@ -520,10 +520,10 @@ fn convert_base(n: BigUint, base: uint) -> ~[BigDigit] {
 
         fn fill_concat(v: &[BigDigit], radix: uint, l: uint) -> ~str {
             if v.is_empty() { return ~"0" }
-            let s = str::concat(vec::reversed(v).map(|n| {
+            let s = vec::reversed(v).map(|n| {
                 let s = uint::to_str_radix(*n as uint, radix);
                 str::from_chars(vec::from_elem(l - s.len(), '0')) + s
-            }));
+            }).concat();
             s.trim_left_chars(['0']).to_owned()
         }
     }
index dad080752388e74a57dcd5a1b82c3bab006b7983..c7d2010e609da045eb3860f6d99431590ebc65d1 100644 (file)
@@ -81,12 +81,12 @@ fn to_str(&self) -> ~str {
         let s = if self.pre.is_empty() {
             s
         } else {
-            s + "-" + str::connect(self.pre.map(|i| i.to_str()), ".")
+            s + "-" + self.pre.map(|i| i.to_str()).connect(".")
         };
         if self.build.is_empty() {
             s
         } else {
-            s + "+" + str::connect(self.build.map(|i| i.to_str()), ".")
+            s + "+" + self.build.map(|i| i.to_str()).connect(".")
         }
     }
 }
index fa9e2c9a724133df9a440f0e9431d31d7731ffb5..496c1f88a6c8a2ec3d59ac5bc405672637379bfc 100644 (file)
@@ -394,7 +394,7 @@ pub fn run_ndk(sess: Session, assembly: &Path, object: &Path) {
             sess.err(fmt!("building with `%s` failed with code %d",
                         cc_prog, prog.status));
             sess.note(fmt!("%s arguments: %s",
-                        cc_prog, str::connect(cc_args, " ")));
+                        cc_prog, cc_args.connect(" ")));
             sess.note(str::from_bytes(prog.error + prog.output));
             sess.abort_if_errors();
         }
@@ -809,14 +809,14 @@ pub fn link_binary(sess: Session,
 
     debug!("output: %s", output.to_str());
     let cc_args = link_args(sess, obj_filename, out_filename, lm);
-    debug!("%s link args: %s", cc_prog, str::connect(cc_args, " "));
+    debug!("%s link args: %s", cc_prog, cc_args.connect(" "));
     // We run 'cc' here
     let prog = run::process_output(cc_prog, cc_args);
     if 0 != prog.status {
         sess.err(fmt!("linking with `%s` failed with code %d",
                       cc_prog, prog.status));
         sess.note(fmt!("%s arguments: %s",
-                       cc_prog, str::connect(cc_args, " ")));
+                       cc_prog, cc_args.connect(" ")));
         sess.note(str::from_bytes(prog.error + prog.output));
         sess.abort_if_errors();
     }
index 5af47880c304365bc192205c87f258abf3e63a8f..ef5670da4558739de9df13250164c9af447ca470 100644 (file)
@@ -328,8 +328,8 @@ pub fn compile_rest(sess: Session,
 
     let outputs = outputs.get_ref();
     if (sess.opts.debugging_opts & session::print_link_args) != 0 {
-        io::println(str::connect(link::link_args(sess,
-            &outputs.obj_filename, &outputs.out_filename, link_meta), " "));
+        io::println(link::link_args(sess, &outputs.obj_filename,
+                                    &outputs.out_filename, link_meta).connect(" "));
     }
 
     // NB: Android hack
index ac92ea759639958a91158c5f8c49fefaa469da43..833146a935e8f305ad3c5fad63944c50f63fa5c8 100644 (file)
@@ -87,7 +87,7 @@ pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
         revoke_clean(bcx, *c);
     }
 
-    let mut constraints = str::connect(constraints, ",");
+    let mut constraints = constraints.connect(",");
 
     let mut clobbers = getClobbers();
     if *ia.clobbers != ~"" && clobbers != ~"" {
index f368255030bd28942244300a58023887d78624f3..b913a1b499617bc82f111d667057637a36d1094d 100644 (file)
@@ -1995,7 +1995,7 @@ pub fn trans_enum_variant(ccx: @CrateContext,
 
     debug!("trans_enum_variant: name=%s tps=%s repr=%? enum_ty=%s",
            unsafe { str::raw::from_c_str(llvm::LLVMGetValueName(llfndecl)) },
-           ~"[" + str::connect(ty_param_substs.map(|&t| ty_to_str(ccx.tcx, t)), ", ") + "]",
+           ~"[" + ty_param_substs.map(|&t| ty_to_str(ccx.tcx.connect(t)), ", ") + "]",
            repr, ty_to_str(ccx.tcx, enum_ty));
 
     adt::trans_start_init(bcx, repr, fcx.llretptr.get(), disr);
index 3b26a2cbf22462eaf45bd88ae81b25d6c4fc971d..8406444bd097eb2a5f8787b28380d5b5fc1ee829 100644 (file)
@@ -192,7 +192,7 @@ pub fn Invoke(cx: block,
     terminate(cx, "Invoke");
     debug!("Invoke(%s with arguments (%s))",
            val_str(cx.ccx().tn, Fn),
-           str::connect(vec::map(Args, |a| val_str(cx.ccx().tn,
+           vec::map(Args.connect(|a| val_str(cx.ccx().tn,
                                                    *a).to_owned()),
                         ", "));
     unsafe {
index a3491114bd32d5532860bb519899b508cd596dac..b29972f039b1936a564209c2fdfca257a8d5d915 100644 (file)
@@ -1483,7 +1483,7 @@ pub fn node_id_type_params(bcx: block, id: ast::node_id) -> ~[ty::t] {
     if !params.all(|t| !ty::type_needs_infer(*t)) {
         bcx.sess().bug(
             fmt!("Type parameters for node %d include inference types: %s",
-                 id, str::connect(params.map(|t| bcx.ty_to_str(*t)), ",")));
+                 id, params.map(|t| bcx.ty_to_str(*t)).connect(",")));
     }
 
     match bcx.fcx.param_substs {
index 9eb5f8159545efc270fa7bef855a5f920cc4c2c0..30dd677396b17f6b6cdd7183802f36393a6e18ca 100644 (file)
@@ -1879,7 +1879,7 @@ fn check_struct_or_variant_fields(fcx: @mut FnCtxt,
                                        } else {
                                            "s"
                                        },
-                                       str::connect(missing_fields, ", ")));
+                                       missing_fields.connect(", ")));
              }
         }
 
index e6e6753255e749864075e7691bd4517d21c547d0..0db9d16adf3c0186c0b681dd38e22b654aabf777 100644 (file)
@@ -100,7 +100,7 @@ pub fn lookup_item(&self, names: &[~str]) -> ast::node_id {
         return match search_mod(self, &self.crate.node.module, 0, names) {
             Some(id) => id,
             None => {
-                fail!("No item found: `%s`", str::connect(names, "::"));
+                fail!("No item found: `%s`", names.connect("::"));
             }
         };
 
index ef3b837e98a16829099ebee687cf1191a8e13cb0..d6623f06c3d338bcbfd48dadf733d6dd90c7b66a 100644 (file)
@@ -35,7 +35,7 @@ fn inf_str(&self, cx: &InferCtxt) -> ~str {
 impl InferStr for FnSig {
     fn inf_str(&self, cx: &InferCtxt) -> ~str {
         fmt!("(%s) -> %s",
-             str::connect(self.inputs.map(|a| a.inf_str(cx)), ", "),
+             self.inputs.map(|a| a.inf_str(cx)).connect(", "),
              self.output.inf_str(cx))
     }
 }
index a44c409aa33b585792f5c3484bf3248c71634829..8d0cba0e8b712dd5064776d7909ab25e6ad99d91 100644 (file)
@@ -111,7 +111,7 @@ pub fn local_rhs_span(l: @ast::local, def: span) -> span {
 
 pub fn pluralize(n: uint, s: ~str) -> ~str {
     if n == 1 { s }
-    else { str::concat([s, ~"s"]) }
+    else { fmt!("%ss", s) }
 }
 
 // A set of node IDs (used to keep track of which node IDs are for statements)
index c72bf5c7f0b21661680833a4bedcbe4320a4358f..b5e6e7e119488cb7222fe37df1d589d62b8cf4c7 100644 (file)
@@ -281,7 +281,7 @@ pub fn vstore_ty_to_str(cx: ctxt, mt: &mt, vs: ty::vstore) -> ~str {
 
 pub fn tys_to_str(cx: ctxt, ts: &[t]) -> ~str {
     let tstrs = ts.map(|t| ty_to_str(cx, *t));
-    fmt!("(%s)", str::connect(tstrs, ", "))
+    fmt!("(%s)", tstrs.connect(", "))
 }
 
 pub fn fn_sig_to_str(cx: ctxt, typ: &ty::FnSig) -> ~str {
@@ -369,7 +369,7 @@ fn closure_to_str(cx: ctxt, cty: &ty::ClosureTy) -> ~str
     fn push_sig_to_str(cx: ctxt, s: &mut ~str, sig: &ty::FnSig) {
         s.push_char('(');
         let strs = sig.inputs.map(|a| fn_input_to_str(cx, *a));
-        s.push_str(str::connect(strs, ", "));
+        s.push_str(strs.connect(", "));
         s.push_char(')');
         if ty::get(sig.output).sty != ty_nil {
             s.push_str(" -> ");
@@ -420,7 +420,7 @@ fn field_to_str(cx: ctxt, f: field) -> ~str {
       ty_type => ~"type",
       ty_tup(ref elems) => {
         let strs = elems.map(|elem| ty_to_str(cx, *elem));
-        ~"(" + str::connect(strs, ",") + ")"
+        ~"(" + strs.connect(",") + ")"
       }
       ty_closure(ref f) => {
           closure_to_str(cx, f)
@@ -477,7 +477,7 @@ pub fn parameterized(cx: ctxt,
 
     if tps.len() > 0u {
         let strs = vec::map(tps, |t| ty_to_str(cx, *t));
-        fmt!("%s%s<%s>", base, r_str, str::connect(strs, ","))
+        fmt!("%s%s<%s>", base, r_str, strs.connect(","))
     } else {
         fmt!("%s%s", base, r_str)
     }
@@ -515,7 +515,7 @@ fn repr(&self, tcx: ctxt) -> ~str {
 */
 
 fn repr_vec<T:Repr>(tcx: ctxt, v: &[T]) -> ~str {
-    fmt!("[%s]", str::connect(v.map(|t| t.repr(tcx)), ","))
+    fmt!("[%s]", v.map(|t| t.repr(tcx)).connect(","))
 }
 
 impl<'self, T:Repr> Repr for &'self [T] {
@@ -569,7 +569,7 @@ fn repr(&self, tcx: ctxt) -> ~str {
         for self.trait_bounds.each |t| {
             res.push(t.repr(tcx));
         }
-        str::connect(res, "+")
+        res.connect("+")
     }
 }
 
@@ -787,7 +787,7 @@ fn user_string(&self, tcx: ctxt) -> ~str {
             for self.each |bb| {
                 result.push(bb.user_string(tcx));
             }
-            str::connect(result, "+")
+            result.connect("+")
         }
     }
 }
index d2d9ec7d79bd85e0a4cc9203ea9f2b52bfcf07d9..47c54ee8e8f4560f0b6d006567d648d61d0dc15c 100644 (file)
@@ -53,7 +53,7 @@ pub fn parse_desc(attrs: ~[ast::attribute]) -> Option<~str> {
     if doc_strs.is_empty() {
         None
     } else {
-        Some(str::connect(doc_strs, "\n"))
+        Some(doc_strs.connect("\n"))
     }
 }
 
index 976344a1825cbdf4f147db0ea8081e5aa310006d..b6917f527a1ff9c96d04130ef8534f27835e42de 100644 (file)
@@ -173,7 +173,7 @@ pub fn header_kind(doc: doc::ItemTag) -> ~str {
 }
 
 pub fn header_name(doc: doc::ItemTag) -> ~str {
-    let fullpath = str::connect(doc.path() + [doc.name()], "::");
+    let fullpath = (doc.path() + [doc.name()]).connect("::");
     match &doc {
         &doc::ModTag(_) if doc.id() != syntax::ast::crate_node_id => {
             fullpath
@@ -414,7 +414,7 @@ fn code_block_indent(s: ~str) -> ~str {
     for str::each_line_any(s) |line| {
         indented.push(fmt!("    %s", line));
     }
-    str::connect(indented, "\n")
+    indented.connect("\n")
 }
 
 fn write_const(
@@ -476,7 +476,7 @@ fn list_item_indent(item: &str) -> ~str {
     // separate markdown elements within `*` lists must be indented by four
     // spaces, or they will escape the list context. indenting everything
     // seems fine though.
-    str::connect_slices(indented, "\n    ")
+    indented.connect("\n    ")
 }
 
 fn write_trait(ctxt: &Ctxt, doc: doc::TraitDoc) {
index 7bcfa1acdfad2578b4da22b864492366cb30985a..353152763267cc5ece79a75071620145ac27307e 100644 (file)
@@ -107,7 +107,7 @@ fn pandoc_writer(
         use core::io::WriterUtil;
 
         debug!("pandoc cmd: %s", pandoc_cmd);
-        debug!("pandoc args: %s", str::connect(pandoc_args, " "));
+        debug!("pandoc args: %s", pandoc_args.connect(" "));
 
         let mut proc = run::Process::new(pandoc_cmd, pandoc_args, run::ProcessOptions::new());
 
@@ -164,7 +164,7 @@ pub fn make_filename(
             }
           }
           doc::ItemPage(doc) => {
-            str::connect(doc.path() + [doc.name()], "_")
+            (doc.path() + [doc.name()]).connect("_")
           }
         }
     };
index ba6f7184f6895cf31e639cd02c41e3ba54c01645..23a4b9c7ba4b7363261c0eebd93e6ba8c80585de 100644 (file)
@@ -87,7 +87,7 @@ fn unindent(s: &str) -> ~str {
                 line.slice(min_indent, line.len()).to_owned()
             }
         };
-        str::connect(unindented, "\n")
+        unindented.connect("\n")
     } else {
         s.to_str()
     }
index 17caaf6bf7d24a40866a286841354aca26e8f4b8..9cb98dd8c2d83a90abdbf611858c991e005b94d2 100644 (file)
@@ -308,7 +308,7 @@ fn run_cmd(repl: &mut Repl, _in: @io::Reader, _out: @io::Writer,
                 println("no crates loaded");
             } else {
                 println(fmt!("crates loaded: %s",
-                                 str::connect(loaded_crates, ", ")));
+                                 loaded_crates.connect(", ")));
             }
         }
         ~"{" => {
index 10d2d139a145b39ac5d0a37fc85c63b0d91d8aba..75e2c3fd4645495f7c1d55486094cb6a5a6208a5 100644 (file)
@@ -207,8 +207,8 @@ pub fn compile_input(ctxt: &Ctx,
 
     let binary = @(copy os::args()[0]);
 
-    debug!("flags: %s", str::connect(flags, " "));
-    debug!("cfgs: %s", str::connect(cfgs, " "));
+    debug!("flags: %s", flags.connect(" "));
+    debug!("cfgs: %s", cfgs.connect(" "));
     debug!("compile_input's sysroot = %?", ctxt.sysroot_opt);
 
     let crate_type = match what {
index 4df07830b2386d13627791cb574b10c7629d2fc1..d62fc8c2cbafdadfdc1282d785e89aecff1d10aa 100644 (file)
@@ -22,7 +22,7 @@
 use libc;
 use option::{None, Option, Some};
 use str;
-use str::StrSlice;
+use str::{StrSlice, StrVector};
 use to_str::ToStr;
 use ascii::{AsciiCast, AsciiStr};
 use old_iter::BaseIter;
@@ -442,7 +442,7 @@ fn to_str(&self) -> ~str {
         if self.is_absolute {
             s += "/";
         }
-        s + str::connect(self.components, "/")
+        s + self.components.connect("/")
     }
 }
 
@@ -629,7 +629,7 @@ fn to_str(&self) -> ~str {
         if self.is_absolute {
             s += "\\";
         }
-        s + str::connect(self.components, "\\")
+        s + self.components.connect("\\")
     }
 }
 
index 4766504813deeac05d9db757cf1df054fcf542ed..c820f6454901062e51e3985d23e4ff6da4b2364a 100644 (file)
@@ -170,18 +170,6 @@ pub fn append(lhs: ~str, rhs: &str) -> ~str {
     v
 }
 
-/// Concatenate a vector of strings
-pub fn concat(v: &[~str]) -> ~str { v.concat() }
-
-/// Concatenate a vector of strings
-pub fn concat_slices(v: &[&str]) -> ~str { v.concat() }
-
-/// Concatenate a vector of strings, placing a given separator between each
-pub fn connect(v: &[~str], sep: &str) -> ~str { v.connect(sep) }
-
-/// Concatenate a vector of strings, placing a given separator between each
-pub fn connect_slices(v: &[&str], sep: &str) -> ~str { v.connect(sep) }
-
 #[allow(missing_doc)]
 pub trait StrVector {
     pub fn concat(&self) -> ~str;
@@ -2495,7 +2483,6 @@ fn t(a: &str, b: &str, start: int) {
     #[test]
     fn test_concat() {
         fn t(v: &[~str], s: &str) {
-            assert_eq!(concat(v), s.to_str());
             assert_eq!(v.concat(), s.to_str());
         }
         t([~"you", ~"know", ~"I'm", ~"no", ~"good"], "youknowI'mnogood");
@@ -2507,7 +2494,6 @@ fn t(v: &[~str], s: &str) {
     #[test]
     fn test_connect() {
         fn t(v: &[~str], sep: &str, s: &str) {
-            assert_eq!(connect(v, sep), s.to_str());
             assert_eq!(v.connect(sep), s.to_str());
         }
         t([~"you", ~"know", ~"I'm", ~"no", ~"good"],
@@ -2520,7 +2506,6 @@ fn t(v: &[~str], sep: &str, s: &str) {
     #[test]
     fn test_concat_slices() {
         fn t(v: &[&str], s: &str) {
-            assert_eq!(concat_slices(v), s.to_str());
             assert_eq!(v.concat(), s.to_str());
         }
         t(["you", "know", "I'm", "no", "good"], "youknowI'mnogood");
@@ -2532,7 +2517,6 @@ fn t(v: &[&str], s: &str) {
     #[test]
     fn test_connect_slices() {
         fn t(v: &[&str], sep: &str, s: &str) {
-            assert_eq!(connect_slices(v, sep), s.to_str());
             assert_eq!(v.connect(sep), s.to_str());
         }
         t(["you", "know", "I'm", "no", "good"],
@@ -3307,7 +3291,6 @@ fn test_line_iter() {
         assert_eq!(lines, ~["", "Märy häd ä little lämb", "", "Little lämb"]);
     }
 
-
     #[test]
     fn test_split_str_iterator() {
         fn t<'a>(s: &str, sep: &'a str, u: ~[&str]) {
index 75439dfaa786ca628c54ee9388f8c44c797416d4..53729dbd1157d2c3ebf7fd63b1624eeb09c625f0 100644 (file)
@@ -10,7 +10,6 @@
 
 use core::prelude::*;
 
-use core::str;
 use core::to_bytes;
 
 #[deriving(Eq)]
@@ -267,7 +266,7 @@ fn to_str(&self) -> ~str {
         for self.each |abi| {
             strs.push(abi.data().name);
         }
-        fmt!("\"%s\"", str::connect_slices(strs, " "))
+        fmt!("\"%s\"", strs.connect(" "))
     }
 }
 
index fecded5e87b21fa2e3b324fe6f3ecbf4ba40819e..8a379a6213aac56e03ee2aaec7b7cf832414b9e1 100644 (file)
@@ -62,7 +62,7 @@ pub fn path_to_str_with_sep(p: &[path_elt], sep: &str, itr: @ident_interner)
           path_name(s) => copy *itr.get(s.name)
         }
     };
-    str::connect(strs, sep)
+    strs.connect(sep)
 }
 
 pub fn path_ident_to_str(p: &path, i: ident, itr: @ident_interner) -> ~str {
index b040397de720d9610dabd354d9b7a73527fc93f3..db7c29edab0686c6cdbf496c6c6b585171eabfc4 100644 (file)
@@ -28,7 +28,7 @@
 
 pub fn path_name_i(idents: &[ident]) -> ~str {
     // FIXME: Bad copies (#2543 -- same for everything else that says "bad")
-    str::connect(idents.map(|i| copy *token::interner_get(i.name)), "::")
+    idents.map(|i| copy *token::interner_get(i.name)).connect("::")
 }
 
 pub fn path_to_ident(p: @Path) -> ident { copy *p.idents.last() }
index 7f8f2be6f6e1ef62b4a51b5bdfc89ee4702af5d6..14cbd170c4822a6f232e12c8631de1444aac0451 100644 (file)
@@ -120,7 +120,7 @@ pub fn expand_asm(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
                     clobs.push(clob);
                 }
 
-                cons = str::connect(clobs, ",");
+                cons = clobs.connect(",");
             }
             Options => {
                 let option = p.parse_str();
index 43bcb68b8e08f7e38703f1d384990fcee0e380e9..cb7386b988003a19d20cfa01a1969d12f164e9e6 100644 (file)
@@ -88,7 +88,7 @@ pub fn analyze(proto: @mut protocol_, _cx: @ExtCtxt) {
     }
 
     if self_live.len() > 0 {
-        let states = str::connect(self_live.map(|s| copy s.name), " ");
+        let states = self_live.map(|s| copy s.name).connect(" ");
 
         debug!("protocol %s is unbounded due to loops involving: %s",
                copy proto.name, states);
index a5725613d589888c7e3200df0d1061bff3f54aff..304c496bbf4d8f3a99cb1462eb9662d2a1301a0d 100644 (file)
@@ -24,7 +24,6 @@
 use opt_vec::OptVec;
 
 use core::iterator::IteratorUtil;
-use core::str;
 use core::vec;
 
 pub trait gen_send {
@@ -100,9 +99,9 @@ fn gen_send(&mut self, cx: @ExtCtxt, try: bool) -> @ast::item {
             }
             body += fmt!("let message = %s(%s);\n",
                          name,
-                         str::connect(vec::append_one(
-                           arg_names.map(|x| cx.str_of(*x)),
-                             ~"s")", "));
+                         vec::append_one(
+                             arg_names.map(|x| cx.str_of(*x)),
+                             ~"s").connect(", "));
 
             if !try {
                 body += fmt!("::std::pipes::send(pipe, message);\n");
@@ -155,8 +154,7 @@ fn gen_send(&mut self, cx: @ExtCtxt, try: bool) -> @ast::item {
                     ~""
                 }
                 else {
-                    ~"(" + str::connect(arg_names.map(|x| copy *x),
-                                        ", ") + ")"
+                    ~"(" + arg_names.map(|x| copy *x).connect(", ") + ")"
                 };
 
                 let mut body = ~"{ ";
index 09c9dd922c7aff534f4c83d6acbb5fc2e5e6f04f..2c6f40091ac9f0e120a1eeb6301362a0561c5bc0 100644 (file)
@@ -92,7 +92,7 @@ fn to_source(&self) -> ~str {
 
     impl<'self> ToSource for &'self [@ast::item] {
         fn to_source(&self) -> ~str {
-            str::connect(self.map(|i| i.to_source()), "\n\n")
+            self.map(|i| i.to_source()).connect("\n\n")
         }
     }
 
@@ -104,7 +104,7 @@ fn to_source(&self) -> ~str {
 
     impl<'self> ToSource for &'self [@ast::Ty] {
         fn to_source(&self) -> ~str {
-            str::connect(self.map(|i| i.to_source()), ", ")
+            self.map(|i| i.to_source()).connect(", ")
         }
     }
 
index 4d1e9a31821d1fff5b4742b8c4bfe99d40bba7d6..79018ebd1eadcc9c2768b43682c3ed82d238dc26 100644 (file)
@@ -23,7 +23,6 @@
 
 use core::io;
 use core::result;
-use core::str;
 use core::vec;
 
 // These macros all relate to the file system; they either return
@@ -74,8 +73,7 @@ pub fn expand_mod(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
     -> base::MacResult {
     base::check_zero_tts(cx, sp, tts, "module_path!");
     base::MRExpr(cx.expr_str(sp,
-                              str::connect(cx.mod_path().map(
-                                  |x| cx.str_of(*x)), "::")))
+                             cx.mod_path().map(|x| cx.str_of(*x)).connect("::")))
 }
 
 // include! : parse the given file as an expr
index a6ec91f899ca89c62f65f71da961a379b791d5d5..0c9ca98fb9d3f260a730501c85f8ca97a15ab84e 100644 (file)
@@ -371,7 +371,7 @@ pub fn parse(
         } else {
             if (bb_eis.len() > 0u && next_eis.len() > 0u)
                 || bb_eis.len() > 1u {
-                let nts = str::connect(vec::map(bb_eis, |ei| {
+                let nts = vec::map(bb_eis.connect(|ei| {
                     match ei.elts[ei.idx].node {
                       match_nonterminal(ref bind,ref name,_) => {
                         fmt!("%s ('%s')", *ident_to_str(name),
index 89fd5c3762a3b86861ebc8f59755725797ef178d..a6933c1648313a25c50d17377143331094d62e94 100644 (file)
@@ -116,7 +116,7 @@ fn block_trim(lines: ~[~str], chars: ~str, max: Option<uint>) -> ~[~str] {
         let lines = block_trim(lines, ~"\t ", None);
         let lines = block_trim(lines, ~"*", Some(1u));
         let lines = block_trim(lines, ~"\t ", None);
-        return str::connect(lines, "\n");
+        return lines.connect("\n");
     }
 
     fail!("not a doc-comment: %s", comment);
index 3ff894c267b8f47d626cd78106f1300692155a29..03b4c0c5ca1c2686045f116d06a54f82a9fecc3b 100644 (file)
@@ -4002,9 +4002,7 @@ fn parse_opt_abis(&self) -> Option<AbiSet> {
                                 fmt!("illegal ABI: \
                                       expected one of [%s], \
                                       found `%s`",
-                                     str::connect_slices(
-                                         abi::all_names(),
-                                         ", "),
+                                     abi::all_names().connect(", "),
                                      word));
                         }
                     }
index 10d448b7952f82e4e7cf41b35c0e12fc3ce4d672..368725607160df4bb33ba7bc71528d169083687d 100644 (file)
@@ -120,7 +120,7 @@ fn to_str(&self) -> ~str {
         let lines = do self.lines.map |line| {str::from_chars(*line)};
 
         // Concatenate the lines together using a new-line.
-        str::connect(lines, "\n")
+        lines.connect("\n")
     }
 }
 
index 972b9c7a525336bc12785160f6426c27b57f5e00..23e5f3945b12dfdb0efa7e959c0df2da44feaa6b 100644 (file)
@@ -98,8 +98,8 @@ enum Result {
   res.push_str(cmd.len().to_str());
   res.push_str("\r\n");
     for cmd.each |s| {
-    res.push_str(str::concat(~[~"$", s.len().to_str(), ~"\r\n",
-                                          copy *s, ~"\r\n"]));
+    res.push_str([~"$", s.len().to_str(), ~"\r\n",
+                  copy *s, ~"\r\n"].concat()));
     }
   res
 }
index 9b94b78512594a858a413116a2a7eedaf6bde01b..bc167e5124fdb0b1811e36b95fef31eee6c649f9 100644 (file)
@@ -26,7 +26,7 @@ fn to_str(&self) -> ~str { int::to_str(*self) }
 
 impl<T:to_str> to_str for ~[T] {
     fn to_str(&self) -> ~str {
-        ~"[" + str::connect(vec::map(*self, |e| e.to_str() ), ", ") + "]"
+        ~"[" + self.map(|e| e.to_str()).connect(", ") + "]"
     }
 }