Lines Matching full:join
193 assert_eq!(v.join(sep).len(), s.len() * 10 + sep.len() * 9);
2078 fn join(b: &mut Bencher) {
2080 b.iter(|| xss.join(&0));
3619 let s = $string.join($delim);
3643 // join has fast paths for small separators up to 4 bytes
9832 assert_eq!(v.join(&0), [1, 0, 2, 3]);
9834 assert_eq!(v.join(&0), [1, 0, 2, 0, 3]);
9840 assert_eq!(v.join(&0), []);
9841 assert_eq!([vec![1], vec![2, 3]].join(&0), [1, 0, 2, 3]);
9842 assert_eq!([vec![1], vec![2], vec![3]].join(&0), [1, 0, 2, 0, 3]);
9845 assert_eq!(v.join(&0), [1, 0, 2, 3]);
9847 assert_eq!(v.join(&0), [1, 0, 2, 0, 3]);
9853 assert_eq!(v.join(","), "");
9854 assert_eq!(["a".to_string(), "ab".into()].join(","), "a,ab");
9855 assert_eq!(["a".to_string(), "ab".into(), "abc".into()].join(","), "a,ab,abc");
9856 assert_eq!(["a".to_string(), "ab".into(), "".into()].join(","), "a,ab,");
15008 use crate::slice::{Concat, Join, SliceIndex};
15051 Join::join(slice, "")
15056 impl<S: Borrow<str>> Join<&str> for [S] {
15059 fn join(slice: &Self, sep: &str) -> String {
15103 // Optimized join implementation that works for both Vec<T> (T: Copy) and String's inner vec
15108 // the bounds for String-join are S: Borrow<str> and for Vec-join Borrow<[T]>
15135 .expect("attempt to join into collection with len > usize::MAX");
15967 t.join().unwrap();
22572 /// assert_eq!(["hello", "world"].join(" "), "hello world");
22573 /// assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
22574 /// assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
22577 pub fn join<Separator>(&self, sep: Separator) -> <Self as Join<Separator>>::Output
22579 Self: Join<Separator>,
22581 Join::join(self, sep)
22595 #[rustc_deprecated(since = "1.3.0", reason = "renamed to join")]
22596 pub fn connect<Separator>(&self, sep: Separator) -> <Self as Join<Separator>>::Output
22598 Self: Join<Separator>,
22600 Join::join(self, sep)
22686 /// Helper trait for [`[T]::join`](slice::join)
22688 pub trait Join<Separator> {
22693 /// Implementation of [`[T]::join`](slice::join)
22695 fn join(slice: &Self, sep: Separator) -> Self::Output;
22713 impl<T: Clone, V: Borrow<[T]>> Join<&T> for [V] {
22716 fn join(slice: &Self, sep: &T) -> Vec<T> {
22735 impl<T: Clone, V: Borrow<[T]>> Join<&[T]> for [V] {
22738 fn join(slice: &Self, sep: &[T]) -> Vec<T> {
28921 .join()