]> git.lizzy.rs Git - rust.git/commitdiff
Change some instances of .connect() to .join()
authorWesley Wiser <wwiser@gmail.com>
Fri, 10 Jul 2015 12:19:21 +0000 (08:19 -0400)
committerWesley Wiser <wwiser@gmail.com>
Fri, 10 Jul 2015 23:40:46 +0000 (19:40 -0400)
39 files changed:
src/compiletest/runtest.rs
src/libcollectionstest/slice.rs
src/libcollectionstest/str.rs
src/libgetopts/lib.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/infer/mod.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_driver/pretty.rs
src/librustc_driver/test.rs
src/librustc_lint/builtin.rs
src/librustc_trans/trans/_match.rs
src/librustc_trans/trans/asm.rs
src/librustc_trans/trans/build.rs
src/librustc_trans/trans/builder.rs
src/librustc_trans/trans/debuginfo/metadata.rs
src/librustc_trans/trans/llrepr.rs
src/librustc_trans/trans/type_.rs
src/librustc_trans/trans/type_of.rs
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/collect.rs
src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs
src/librustdoc/html/markdown.rs
src/librustdoc/html/render.rs
src/librustdoc/passes.rs
src/librustdoc/test.rs
src/libstd/net/ip.rs
src/libsyntax/ast_util.rs
src/libsyntax/ext/source_util.rs
src/libsyntax/ext/tt/macro_parser.rs
src/libsyntax/parse/lexer/comments.rs
src/libsyntax/parse/parser.rs
src/libtest/lib.rs
src/test/auxiliary/plugin_args.rs
src/test/run-pass/issue-3563-3.rs
src/test/run-pass/trait-to-str.rs

index 93054f39790858882e47d0cdab6f9851bc51eb2e..5b62f29b8242323df0ac7e07c43ad7631925b745 100644 (file)
@@ -344,7 +344,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
         check_lines,
         breakpoint_lines
     } = parse_debugger_commands(testfile, "gdb");
-    let mut cmds = commands.connect("\n");
+    let mut cmds = commands.join("\n");
 
     // compile test file (it should have 'compile-flags:-g' in the header)
     let compiler_run_result = compile_test(config, props, testfile);
@@ -799,7 +799,7 @@ fn cleanup_debug_info_options(options: &Option<String>) -> Option<String> {
         split_maybe_args(options).into_iter()
                                  .filter(|x| !options_to_remove.contains(x))
                                  .collect::<Vec<String>>()
-                                 .connect(" ");
+                                 .join(" ");
     Some(new_options)
 }
 
@@ -1412,7 +1412,7 @@ fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
 
     // Linux and mac don't require adjusting the library search path
     if cfg!(unix) {
-        format!("{} {}", prog, args.connect(" "))
+        format!("{} {}", prog, args.join(" "))
     } else {
         // Build the LD_LIBRARY_PATH variable as it would be seen on the command line
         // for diagnostic purposes
@@ -1420,7 +1420,7 @@ fn lib_path_cmd_prefix(path: &str) -> String {
             format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
         }
 
-        format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
+        format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.join(" "))
     }
 }
 
index d88d8b8e4a06822de36e6ab26f2f37c1336d680e..436e71fd4a0ed1ef6337fa5ccec99585b42379d8 100644 (file)
@@ -606,22 +606,22 @@ fn test_concat() {
     assert_eq!(d, [1, 2, 3]);
 
     let v: &[&[_]] = &[&[1], &[2, 3]];
-    assert_eq!(v.connect(&0), [1, 0, 2, 3]);
+    assert_eq!(v.join(&0), [1, 0, 2, 3]);
     let v: &[&[_]] = &[&[1], &[2], &[3]];
-    assert_eq!(v.connect(&0), [1, 0, 2, 0, 3]);
+    assert_eq!(v.join(&0), [1, 0, 2, 0, 3]);
 }
 
 #[test]
-fn test_connect() {
+fn test_join() {
     let v: [Vec<i32>; 0] = [];
-    assert_eq!(v.connect(&0), []);
-    assert_eq!([vec![1], vec![2, 3]].connect(&0), [1, 0, 2, 3]);
-    assert_eq!([vec![1], vec![2], vec![3]].connect(&0), [1, 0, 2, 0, 3]);
+    assert_eq!(v.join(&0), []);
+    assert_eq!([vec![1], vec![2, 3]].join(&0), [1, 0, 2, 3]);
+    assert_eq!([vec![1], vec![2], vec![3]].join(&0), [1, 0, 2, 0, 3]);
 
     let v: [&[_]; 2] = [&[1], &[2, 3]];
-    assert_eq!(v.connect(&0), [1, 0, 2, 3]);
+    assert_eq!(v.join(&0), [1, 0, 2, 3]);
     let v: [&[_]; 3] = [&[1], &[2], &[3]];
-    assert_eq!(v.connect(&0), [1, 0, 2, 0, 3]);
+    assert_eq!(v.join(&0), [1, 0, 2, 0, 3]);
 }
 
 #[test]
@@ -1339,11 +1339,11 @@ fn concat(b: &mut Bencher) {
     }
 
     #[bench]
-    fn connect(b: &mut Bencher) {
+    fn join(b: &mut Bencher) {
         let xss: Vec<Vec<i32>> =
             (0..100).map(|i| (0..i).collect()).collect();
         b.iter(|| {
-            xss.connect(&0)
+            xss.join(&0)
         });
     }
 
index 87a018ced195accee2164df7b341a5c85d1913a3..e92af585c15726bb9ac7204195f18d4545c8ea7c 100644 (file)
@@ -158,32 +158,32 @@ fn test_concat_for_different_lengths() {
     test_concat!("abc", ["", "a", "bc"]);
 }
 
-macro_rules! test_connect {
+macro_rules! test_join {
     ($expected: expr, $string: expr, $delim: expr) => {
         {
-            let s = $string.connect($delim);
+            let s = $string.join($delim);
             assert_eq!($expected, s);
         }
     }
 }
 
 #[test]
-fn test_connect_for_different_types() {
-    test_connect!("a-b", ["a", "b"], "-");
+fn test_join_for_different_types() {
+    test_join!("a-b", ["a", "b"], "-");
     let hyphen = "-".to_string();
-    test_connect!("a-b", [s("a"), s("b")], &*hyphen);
-    test_connect!("a-b", vec!["a", "b"], &*hyphen);
-    test_connect!("a-b", &*vec!["a", "b"], "-");
-    test_connect!("a-b", vec![s("a"), s("b")], "-");
+    test_join!("a-b", [s("a"), s("b")], &*hyphen);
+    test_join!("a-b", vec!["a", "b"], &*hyphen);
+    test_join!("a-b", &*vec!["a", "b"], "-");
+    test_join!("a-b", vec![s("a"), s("b")], "-");
 }
 
 #[test]
-fn test_connect_for_different_lengths() {
+fn test_join_for_different_lengths() {
     let empty: &[&str] = &[];
-    test_connect!("", empty, "-");
-    test_connect!("a", ["a"], "-");
-    test_connect!("a-b", ["a", "b"], "-");
-    test_connect!("-a-bc", ["", "a", "bc"], "-");
+    test_join!("", empty, "-");
+    test_join!("a", ["a"], "-");
+    test_join!("a-b", ["a", "b"], "-");
+    test_join!("-a-bc", ["", "a", "bc"], "-");
 }
 
 #[test]
@@ -2081,12 +2081,12 @@ fn split_slice(b: &mut Bencher) {
     }
 
     #[bench]
-    fn bench_connect(b: &mut Bencher) {
+    fn bench_join(b: &mut Bencher) {
         let s = "ศไทย中华Việt Nam; Mary had a little lamb, Little lamb";
         let sep = "→";
         let v = vec![s, s, s, s, s, s, s, s, s, s];
         b.iter(|| {
-            assert_eq!(v.connect(sep).len(), s.len() * 10 + sep.len() * 9);
+            assert_eq!(v.join(sep).len(), s.len() * 10 + sep.len() * 9);
         })
     }
 
index 0d15f584d648aed652a39452175e7a10cc0cd95e..65e85b92e0b2c1a1a1c5e65ad62e7f578bfe9730 100644 (file)
@@ -784,13 +784,13 @@ pub fn usage(brief: &str, opts: &[OptGroup]) -> String {
 
         // FIXME: #5516 should be graphemes not codepoints
         // wrapped description
-        row.push_str(&desc_rows.connect(&desc_sep[..]));
+        row.push_str(&desc_rows.join(&desc_sep[..]));
 
         row
     });
 
     format!("{}\n\nOptions:\n{}\n", brief,
-            rows.collect::<Vec<String>>().connect("\n"))
+            rows.collect::<Vec<String>>().join("\n"))
 }
 
 fn format_option(opt: &OptGroup) -> String {
@@ -836,7 +836,7 @@ pub fn short_usage(program_name: &str, opts: &[OptGroup]) -> String {
     line.push_str(&opts.iter()
                        .map(format_option)
                        .collect::<Vec<String>>()
-                       .connect(" ")[..]);
+                       .join(" ")[..]);
     line
 }
 
index a9e9f17bdce75e31170e6b392c4097cf21f3a110..f38369e3f4c054910acd0f2d6ac17f3969cb43fa 100644 (file)
@@ -2028,7 +2028,7 @@ fn encode_dylib_dependency_formats(rbml_w: &mut Encoder, ecx: &EncodeContext) {
                     cstore::RequireStatic => "s",
                 })).to_string())
             }).collect::<Vec<String>>();
-            rbml_w.wr_tagged_str(tag, &s.connect(","));
+            rbml_w.wr_tagged_str(tag, &s.join(","));
         }
         None => {
             rbml_w.wr_tagged_str(tag, "");
index 63f31921ec2ecb1fba74cd79b91c052797e61a5b..e24fadba6a55e38ef0428f571e32c52fc3398f44 100644 (file)
@@ -1098,7 +1098,7 @@ pub fn ty_to_string(&self, t: Ty<'tcx>) -> String {
 
     pub fn tys_to_string(&self, ts: &[Ty<'tcx>]) -> String {
         let tstrs: Vec<String> = ts.iter().map(|t| self.ty_to_string(*t)).collect();
-        format!("({})", tstrs.connect(", "))
+        format!("({})", tstrs.join(", "))
     }
 
     pub fn trait_ref_to_string(&self, t: &ty::TraitRef<'tcx>) -> String {
index 9541076df82be575eb3e80b12858558ca25bc949..67301a09e52bf63a6e10225e3a25bf815f62c2b8 100644 (file)
@@ -843,7 +843,7 @@ fn write_out_deps(sess: &Session,
         let mut file = try!(fs::File::create(&deps_filename));
         for path in &out_filenames {
             try!(write!(&mut file,
-                        "{}: {}\n\n", path.display(), files.connect(" ")));
+                        "{}: {}\n\n", path.display(), files.join(" ")));
         }
         Ok(())
     })();
index 7ccada1079ff908f2c4fd812507d5d68ae7a4778..2906fd35a0a1867bc6fe8d0070dc767919929aff 100644 (file)
@@ -606,7 +606,7 @@ fn sort_lint_groups(lints: Vec<(&'static str, Vec<lint::LintId>, bool)>)
         for (name, to) in lints {
             let name = name.to_lowercase().replace("_", "-");
             let desc = to.into_iter().map(|x| x.as_str().replace("_", "-"))
-                         .collect::<Vec<String>>().connect(", ");
+                         .collect::<Vec<String>>().join(", ");
             println!("    {}  {}",
                      padded(&name[..]), desc);
         }
index 610f3f3a75ee64b40e6c7ffc7211c42aeca6e41b..0e735cbb7ff8ebabea7d1761de84c44c3acad2f1 100644 (file)
@@ -378,7 +378,7 @@ impl UserIdentifiedItem {
     fn reconstructed_input(&self) -> String {
         match *self {
             ItemViaNode(node_id) => node_id.to_string(),
-            ItemViaPath(ref parts) => parts.connect("::"),
+            ItemViaPath(ref parts) => parts.join("::"),
         }
     }
 
index 128b0b7baabc09835e89b619fba28a7774b8b5bd..a9efd13a998986a5a6e706769b01a3e3c1ce8057 100644 (file)
@@ -178,7 +178,7 @@ pub fn lookup_item(&self, names: &[String]) -> ast::NodeId {
         return match search_mod(self, &self.infcx.tcx.map.krate().module, 0, names) {
             Some(id) => id,
             None => {
-                panic!("no item found: `{}`", names.connect("::"));
+                panic!("no item found: `{}`", names.join("::"));
             }
         };
 
index 186361626fff32c314c7b3f54e74a3fa6dbea072..1574080b313b595d3e5910db7f93e5b41eddbf88 100644 (file)
@@ -923,7 +923,7 @@ fn to_snake_case(mut str: &str) -> String {
             }
             words.push(buf);
         }
-        words.connect("_")
+        words.join("_")
     }
 
     fn check_snake_case(&self, cx: &Context, sort: &str, name: &str, span: Option<Span>) {
index 936b0070dfccf9cce3d8674075dd964246cfb4df..3aa98ab031d1dcd8265df3c50639d66ca8d9ca25 100644 (file)
@@ -936,7 +936,7 @@ fn compile_guard<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
            bcx.to_str(),
            guard_expr,
            m,
-           vals.iter().map(|v| bcx.val_to_string(*v)).collect::<Vec<_>>().connect(", "));
+           vals.iter().map(|v| bcx.val_to_string(*v)).collect::<Vec<_>>().join(", "));
     let _indenter = indenter();
 
     let mut bcx = insert_lllocals(bcx, &data.bindings_map, None);
@@ -981,7 +981,7 @@ fn compile_submatch<'a, 'p, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
     debug!("compile_submatch(bcx={}, m={:?}, vals=[{}])",
            bcx.to_str(),
            m,
-           vals.iter().map(|v| bcx.val_to_string(*v)).collect::<Vec<_>>().connect(", "));
+           vals.iter().map(|v| bcx.val_to_string(*v)).collect::<Vec<_>>().join(", "));
     let _indenter = indenter();
     let _icx = push_ctxt("match::compile_submatch");
     let mut bcx = bcx;
index b25d6f2daaca93fe865bbd879895dfd488c078d5..67e7aa5baf62b2595773b0a7f3719aaa92940542 100644 (file)
@@ -92,7 +92,7 @@ pub fn trans_inline_asm<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, ia: &ast::InlineAsm)
                                     .chain(arch_clobbers.iter()
                                                .map(|s| s.to_string()))
                                     .collect::<Vec<String>>()
-                                    .connect(",");
+                                    .join(",");
 
     debug!("Asm Constraints: {}", &all_constraints[..]);
 
index 05d0a967e64b6e13d76e2ea50153b7a17fe46d80..7d6825040442334af737360939c6e5702219147c 100644 (file)
@@ -148,7 +148,7 @@ pub fn Invoke(cx: Block,
     terminate(cx, "Invoke");
     debug!("Invoke({} with arguments ({}))",
            cx.val_to_string(fn_),
-           args.iter().map(|a| cx.val_to_string(*a)).collect::<Vec<String>>().connect(", "));
+           args.iter().map(|a| cx.val_to_string(*a)).collect::<Vec<String>>().join(", "));
     debug_loc.apply(cx.fcx);
     B(cx).invoke(fn_, args, then, catch, attributes)
 }
index e100defc248755c0155544783d01f21cc52051dc..32d9ee7a508b19e5d5741c9645716bc2b3693829 100644 (file)
@@ -167,7 +167,7 @@ pub fn invoke(&self,
                args.iter()
                    .map(|&v| self.ccx.tn().val_to_string(v))
                    .collect::<Vec<String>>()
-                   .connect(", "));
+                   .join(", "));
 
         unsafe {
             let v = llvm::LLVMBuildInvoke(self.llbuilder,
@@ -809,7 +809,7 @@ pub fn call(&self, llfn: ValueRef, args: &[ValueRef],
                args.iter()
                    .map(|&v| self.ccx.tn().val_to_string(v))
                    .collect::<Vec<String>>()
-                   .connect(", "));
+                   .join(", "));
 
         unsafe {
             let v = llvm::LLVMBuildCall(self.llbuilder, llfn, args.as_ptr(),
index 45349969a0b3e33000f5570f3bfe36e8a3d5cd57..45d8fa67db683bdc78f64575d305ac730d75096c 100644 (file)
@@ -1443,7 +1443,7 @@ fn create_member_descriptions<'a>(&self, cx: &CrateContext<'a, 'tcx>)
                 let discrfield = discrfield.iter()
                                            .skip(1)
                                            .map(|x| x.to_string())
-                                           .collect::<Vec<_>>().connect("$");
+                                           .collect::<Vec<_>>().join("$");
                 let union_member_name = format!("RUST$ENCODED$ENUM${}${}",
                                                 discrfield,
                                                 null_variant_name);
index 6dd566797970e5aa820675ee245706d293a424b7..6b785e7edfd6a1568a38e2b589089f91e129b831 100644 (file)
@@ -19,7 +19,7 @@ pub trait LlvmRepr {
 impl<T:LlvmRepr> LlvmRepr for [T] {
     fn llrepr(&self, ccx: &CrateContext) -> String {
         let reprs: Vec<String> = self.iter().map(|t| t.llrepr(ccx)).collect();
-        format!("[{}]", reprs.connect(","))
+        format!("[{}]", reprs.join(","))
     }
 }
 
index ac39d10a23d6ed59e09d79854fd802174f00ff05..c88509dac4caa5ae80c621fc2487405a82ae6c18 100644 (file)
@@ -322,7 +322,7 @@ pub fn type_to_string(&self, ty: Type) -> String {
 
     pub fn types_to_str(&self, tys: &[Type]) -> String {
         let strs: Vec<String> = tys.iter().map(|t| self.type_to_string(*t)).collect();
-        format!("[{}]", strs.connect(","))
+        format!("[{}]", strs.join(","))
     }
 
     pub fn val_to_string(&self, val: ValueRef) -> String {
index 4359a8d270da260c7283fc320cf2b21be8338fbd..36905ffe93b942a320e106c6d9be06559f44715e 100644 (file)
@@ -457,7 +457,7 @@ fn llvm_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
     let tstr = if strings.is_empty() {
         base
     } else {
-        format!("{}<{}>", base, strings.connect(", "))
+        format!("{}<{}>", base, strings.join(", "))
     };
 
     if did.krate == 0 {
index 4d86a4f7c70ff159fe7425cbb23d5bcd0d4e971c..f14886606c218462626b4c408eb84f67c2a17cf7 100644 (file)
@@ -134,7 +134,7 @@ pub fn report_error<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                                      p.self_ty(),
                                      p))
                     .collect::<Vec<_>>()
-                    .connect(", ");
+                    .join(", ");
                 cx.sess.fileline_note(
                     span,
                     &format!("the method `{}` exists but the \
index 638cc86852742b21c6230ea162b00c21aac42648..0f9ebf3713c5887212ae3c1c0249f02442342410 100644 (file)
@@ -1002,7 +1002,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
             "not all trait items implemented, missing: `{}`",
             missing_items.iter()
                   .map(<ast::Name>::as_str)
-                  .collect::<Vec<_>>().connect("`, `"))
+                  .collect::<Vec<_>>().join("`, `"))
     }
 
     if !invalidated_items.is_empty() {
@@ -1013,7 +1013,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
                   invalidator.ident.as_str(),
                   invalidated_items.iter()
                                    .map(<ast::Name>::as_str)
-                                   .collect::<Vec<_>>().connect("`, `"))
+                                   .collect::<Vec<_>>().join("`, `"))
     }
 }
 
@@ -2868,7 +2868,7 @@ fn check_struct_or_variant_fields<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                 span_err!(tcx.sess, span, E0063,
                     "missing field{}: {}",
                     if missing_fields.len() == 1 {""} else {"s"},
-                    missing_fields.connect(", "));
+                    missing_fields.join(", "));
              }
         }
 
index 20407e927f7ff7f3bcc1164e027cfdcb8be91258..cd904425d6346ef1ab74ce34ac2cf96677776136 100644 (file)
@@ -514,7 +514,7 @@ fn check_implementations_of_coerce_unsized(&self) {
                                                 } else {
                                                     name.to_string()
                                                 }, a, b)
-                                   }).collect::<Vec<_>>().connect(", "));
+                                   }).collect::<Vec<_>>().join(", "));
                         return;
                     }
 
index e170808ad07d679fc7da428fc279ed424b68bb00..5d2e3533efccf0f2c2bd8e97543663eca86f1eb6 100644 (file)
@@ -1536,7 +1536,7 @@ fn convert_typed_item<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
                                      d => format!("{:?}", d),
                                  })
                                  .collect::<Vec<String>>()
-                                 .connect(",");
+                                 .join(",");
 
         tcx.sess.span_err(it.span, &object_lifetime_default_reprs);
     }
index c25267520ccd80d89289741058fca3e28254f342..daa4e1af3382d011a46168d0825dc086d5795031 100644 (file)
@@ -2536,12 +2536,12 @@ fn name_from_pat(p: &ast::Pat) -> String {
             format!("{} {{ {}{} }}", path_to_string(name),
                 fields.iter().map(|&Spanned { node: ref fp, .. }|
                                   format!("{}: {}", fp.ident.as_str(), name_from_pat(&*fp.pat)))
-                             .collect::<Vec<String>>().connect(", "),
+                             .collect::<Vec<String>>().join(", "),
                 if etc { ", ..." } else { "" }
             )
         },
         PatTup(ref elts) => format!("({})", elts.iter().map(|p| name_from_pat(&**p))
-                                            .collect::<Vec<String>>().connect(", ")),
+                                            .collect::<Vec<String>>().join(", ")),
         PatBox(ref p) => name_from_pat(&**p),
         PatRegion(ref p, _) => name_from_pat(&**p),
         PatLit(..) => {
@@ -2555,7 +2555,7 @@ fn name_from_pat(p: &ast::Pat) -> String {
             let begin = begin.iter().map(|p| name_from_pat(&**p));
             let mid = mid.as_ref().map(|p| format!("..{}", name_from_pat(&**p))).into_iter();
             let end = end.iter().map(|p| name_from_pat(&**p));
-            format!("[{}]", begin.chain(mid).chain(end).collect::<Vec<_>>().connect(", "))
+            format!("[{}]", begin.chain(mid).chain(end).collect::<Vec<_>>().join(", "))
         },
         PatMac(..) => {
             warn!("can't document the name of a function argument \
index 9439fc3c5f405ffedf729376462f0dc3f5c491e6..fc06dc347b5ede49e6f6015975cfac90e84f4cb5 100644 (file)
@@ -360,7 +360,7 @@ fn resolved_path(w: &mut fmt::Formatter, did: ast::DefId, path: &clean::Path,
     match href(did) {
         Some((url, shortty, fqp)) => {
             try!(write!(w, "<a class='{}' href='{}' title='{}'>{}</a>",
-                          shortty, url, fqp.connect("::"), last.name));
+                          shortty, url, fqp.join("::"), last.name));
         }
         _ => try!(write!(w, "{}", last.name)),
     }
index 4982215d02f49f45d81e2a0f1c747cebcbda41de..4ec4ffb0c31af08e12381c945a82553dcf28ef60 100644 (file)
@@ -199,7 +199,7 @@ fn stripped_filtered_line<'a>(s: &'a str) -> Option<&'a str> {
 fn collapse_whitespace(s: &str) -> String {
     s.split(|c: char| c.is_whitespace()).filter(|s| {
         !s.is_empty()
-    }).collect::<Vec<_>>().connect(" ")
+    }).collect::<Vec<_>>().join(" ")
 }
 
 thread_local!(static USED_HEADER_MAP: RefCell<HashMap<String, usize>> = {
@@ -238,14 +238,14 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
             let lines = origtext.lines().filter(|l| {
                 stripped_filtered_line(*l).is_none()
             });
-            let text = lines.collect::<Vec<&str>>().connect("\n");
+            let text = lines.collect::<Vec<&str>>().join("\n");
             if rendered { return }
             PLAYGROUND_KRATE.with(|krate| {
                 let mut s = String::new();
                 krate.borrow().as_ref().map(|krate| {
                     let test = origtext.lines().map(|l| {
                         stripped_filtered_line(l).unwrap_or(l)
-                    }).collect::<Vec<&str>>().connect("\n");
+                    }).collect::<Vec<&str>>().join("\n");
                     let krate = krate.as_ref().map(|s| &**s);
                     let test = test::maketest(&test, krate, false,
                                               &Default::default());
@@ -275,7 +275,7 @@ pub fn render(w: &mut fmt::Formatter, s: &str, print_toc: bool) -> fmt::Result {
 
         // Transform the contents of the header into a hyphenated string
         let id = s.split_whitespace().map(|s| s.to_ascii_lowercase())
-            .collect::<Vec<String>>().connect("-");
+            .collect::<Vec<String>>().join("-");
 
         // This is a terrible hack working around how hoedown gives us rendered
         // html for text rather than the raw text.
@@ -387,7 +387,7 @@ pub fn find_testable_code(doc: &str, tests: &mut ::test::Collector) {
             let lines = text.lines().map(|l| {
                 stripped_filtered_line(l).unwrap_or(l)
             });
-            let text = lines.collect::<Vec<&str>>().connect("\n");
+            let text = lines.collect::<Vec<&str>>().join("\n");
             tests.add_test(text.to_string(),
                            block_info.should_panic, block_info.no_run,
                            block_info.ignore, block_info.test_harness);
index 5ecf0fe8ecfb928a92f59c9f102e9b172fe94756..07e3ae975d66d0a313e556e046243fa13e6ff9bb 100644 (file)
@@ -285,7 +285,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         let inputs: Vec<String> = self.inputs.iter().map(|ref t| {
             format!("{}", t)
         }).collect();
-        try!(write!(f, "{{\"inputs\":[{}],\"output\":", inputs.connect(",")));
+        try!(write!(f, "{{\"inputs\":[{}],\"output\":", inputs.join(",")));
 
         match self.output {
             Some(ref t) => try!(write!(f, "{}", t)),
@@ -461,7 +461,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::Result<String> {
                     search_index.push(IndexItem {
                         ty: shortty(item),
                         name: item.name.clone().unwrap(),
-                        path: fqp[..fqp.len() - 1].connect("::"),
+                        path: fqp[..fqp.len() - 1].join("::"),
                         desc: shorter(item.doc_value()),
                         parent: Some(did),
                         search_type: get_index_search_type(&item, parent_basename),
@@ -957,7 +957,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                     self.search_index.push(IndexItem {
                         ty: shortty(&item),
                         name: s.to_string(),
-                        path: path.connect("::").to_string(),
+                        path: path.join("::").to_string(),
                         desc: shorter(item.doc_value()),
                         parent: parent,
                         search_type: get_index_search_type(&item, parent_basename),
@@ -1187,7 +1187,7 @@ fn render(w: File, cx: &Context, it: &clean::Item,
                 *slot.borrow_mut() = cx.current.clone();
             });
 
-            let mut title = cx.current.connect("::");
+            let mut title = cx.current.join("::");
             if pushname {
                 if !title.is_empty() {
                     title.push_str("::");
@@ -1393,7 +1393,7 @@ fn href(&self, cx: &Context) -> Option<String> {
             Some(format!("{root}src/{krate}/{path}.html#{href}",
                          root = self.cx.root_path,
                          krate = self.cx.layout.krate,
-                         path = path.connect("/"),
+                         path = path.join("/"),
                          href = href))
 
         // If this item is not part of the local crate, then things get a little
@@ -1417,7 +1417,7 @@ fn href(&self, cx: &Context) -> Option<String> {
             };
             Some(format!("{root}{path}/{file}?gotosrc={goto}",
                          root = root,
-                         path = path[..path.len() - 1].connect("/"),
+                         path = path[..path.len() - 1].join("/"),
                          file = item_path(self.item),
                          goto = self.item.def_id.node))
         }
@@ -1523,7 +1523,7 @@ fn item_path(item: &clean::Item) -> String {
 }
 
 fn full_path(cx: &Context, item: &clean::Item) -> String {
-    let mut s = cx.current.connect("::");
+    let mut s = cx.current.join("::");
     s.push_str("::");
     s.push_str(item.name.as_ref().unwrap());
     return s
@@ -1535,7 +1535,7 @@ fn shorter<'a>(s: Option<&'a str>) -> String {
             (*line).chars().any(|chr|{
                 !chr.is_whitespace()
             })
-        }).collect::<Vec<_>>().connect("\n"),
+        }).collect::<Vec<_>>().join("\n"),
         None => "".to_string()
     }
 }
@@ -1920,12 +1920,12 @@ fn trait_item(w: &mut fmt::Formatter, m: &clean::Item)
     try!(write!(w, r#"<script type="text/javascript" async
                               src="{root_path}/implementors/{path}/{ty}.{name}.js">
                       </script>"#,
-                root_path = vec![".."; cx.current.len()].connect("/"),
+                root_path = vec![".."; cx.current.len()].join("/"),
                 path = if ast_util::is_local(it.def_id) {
-                    cx.current.connect("/")
+                    cx.current.join("/")
                 } else {
                     let path = &cache.external_paths[&it.def_id];
-                    path[..path.len() - 1].connect("/")
+                    path[..path.len() - 1].join("/")
                 },
                 ty = shortty(it).to_static_str(),
                 name = *it.name.as_ref().unwrap()));
index 74c16127f41ccac87c3bf3aba6d2acb37b644c7e..6e1c8beb3ada12d8b608112cac4deac35db30c39 100644 (file)
@@ -361,7 +361,7 @@ pub fn unindent(s: &str) -> String {
                 line[min_indent..].to_string()
             }
         }).collect::<Vec<_>>());
-        unindented.connect("\n")
+        unindented.join("\n")
     } else {
         s.to_string()
     }
index 1ac95177860680cd7d59d710f3f0b9fa533e0d6c..3ce2922c4c97dba710f14775726bb9448e58d9a9 100644 (file)
@@ -360,7 +360,7 @@ pub fn add_test(&mut self, test: String,
             let s = self.current_header.as_ref().map(|s| &**s).unwrap_or("");
             format!("{}_{}", s, self.cnt)
         } else {
-            format!("{}_{}", self.names.connect("::"), self.cnt)
+            format!("{}_{}", self.names.join("::"), self.cnt)
         };
         self.cnt += 1;
         let libs = self.libs.clone();
index bc13d966a10b7b74eb450922f978f1ade95f4cc8..3fe44d4809e5e03019dd7e4c9c3ef2506f33f9b0 100644 (file)
@@ -442,7 +442,7 @@ fn fmt_subslice(segments: &[u16]) -> String {
                             .iter()
                             .map(|&seg| format!("{:x}", seg))
                             .collect::<Vec<String>>()
-                            .connect(":")
+                            .join(":")
                     }
 
                     write!(fmt, "{}::{}",
index 7d7ea371ba5339e52e6de84dd70e849d89c4b50d..6b38762316cdc529cf4bc1bd05b2926a75c0e4d9 100644 (file)
@@ -27,7 +27,7 @@ pub fn path_name_i(idents: &[Ident]) -> String {
     // FIXME: Bad copies (#2543 -- same for everything else that says "bad")
     idents.iter().map(|i| {
         token::get_ident(*i).to_string()
-    }).collect::<Vec<String>>().connect("::")
+    }).collect::<Vec<String>>().join("::")
 }
 
 pub fn local_def(id: NodeId) -> DefId {
index 3866f5534c2ebb4b10c357b5bf252ce6665f47d2..5418b1f43e4af75a535e51e011c831d03d0eb4ee 100644 (file)
@@ -78,7 +78,7 @@ pub fn expand_mod(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
                    .iter()
                    .map(|x| token::get_ident(*x).to_string())
                    .collect::<Vec<String>>()
-                   .connect("::");
+                   .join("::");
     base::MacEager::expr(cx.expr_str(
             sp,
             token::intern_and_get_ident(&string[..])))
index 5521c68e75c6950f513c3519411d009983f1f490..5b3887e76b494ce7ca6037ad5b6c09d9f2b7be14 100644 (file)
@@ -465,7 +465,7 @@ pub fn parse(sess: &ParseSess,
                                 token::get_ident(bind))).to_string()
                       }
                       _ => panic!()
-                    } }).collect::<Vec<String>>().connect(" or ");
+                    } }).collect::<Vec<String>>().join(" or ");
                 return Error(sp, format!(
                     "local ambiguity: multiple parsing options: \
                      built-in NTs {} or {} other options.",
index 1577b50ad760caad882cbbcc98abc894293669e9..467345624c275107f8139e73d08dc0ad69326f26 100644 (file)
@@ -139,7 +139,7 @@ fn horizontal_trim(lines: Vec<String> ) -> Vec<String> {
         let lines = vertical_trim(lines);
         let lines = horizontal_trim(lines);
 
-        return lines.connect("\n");
+        return lines.join("\n");
     }
 
     panic!("not a doc-comment: {}", comment);
index 81ae607fea250cbe09f9b4b17bce90d552b4f057..d77b529a3bf0bc0e71419516dd54ea3131c52074 100644 (file)
@@ -5215,7 +5215,7 @@ fn parse_opt_abi(&mut self) -> PResult<Option<abi::Abi>> {
                             last_span,
                             &format!("illegal ABI: expected one of [{}], \
                                      found `{}`",
-                                    abi::all_names().connect(", "),
+                                    abi::all_names().join(", "),
                                     the_string));
                         Ok(None)
                     }
index 724c0b2a8927f9af7f5eaad48069b348e97828cf..629e3920e1041afc4e741dd81ec76f8955ae743e 100644 (file)
@@ -1080,7 +1080,7 @@ pub fn fmt_metrics(&self) -> String {
             .map(|(k,v)| format!("{}: {} (+/- {})", *k,
                                  v.value, v.noise))
             .collect();
-        v.connect(", ")
+        v.join(", ")
     }
 }
 
index 5a615502a95e3200a11aae532eb4c3b4a1e74ffb..1920185d4e5a0cd018ae62a30bab3169887d8a1b 100644 (file)
@@ -36,7 +36,7 @@ fn expand<'cx>(&self,
                    sp: Span,
                    _: &[ast::TokenTree]) -> Box<MacResult+'cx> {
         let args = self.args.iter().map(|i| pprust::meta_item_to_string(&*i))
-            .collect::<Vec<_>>().connect(", ");
+            .collect::<Vec<_>>().join(", ");
         let interned = token::intern_and_get_ident(&args[..]);
         MacEager::expr(ecx.expr_str(sp, interned))
     }
index 5cd58c0ecfb262221e76df2d25c1323344b8eb04..ecee2fd0faaca04542198f0c8baa8f6bad57eda8 100644 (file)
@@ -108,7 +108,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                               .collect::<Vec<String>>();
 
         // Concatenate the lines together using a new-line.
-        write!(f, "{}", lines.connect("\n"))
+        write!(f, "{}", lines.join("\n"))
     }
 }
 
index 8fa628def79691c5f12386837f61b8538b112fd3..f5af05d872bd43a9c648fc830511b720a19f2b73 100644 (file)
@@ -24,7 +24,7 @@ fn to_string_(&self) -> String {
                 self.iter()
                     .map(|e| e.to_string_())
                     .collect::<Vec<String>>()
-                    .connect(", "))
+                    .join(", "))
     }
 }