@@ -168,7 +168,7 @@ impl<T> [T] {
168168 core_slice:: SliceExt :: len ( self )
169169 }
170170
171- /// Returns true if the slice has a length of 0
171+ /// Returns true if the slice has a length of 0.
172172 ///
173173 /// # Example
174174 ///
@@ -402,7 +402,7 @@ impl<T> [T] {
402402 core_slice:: SliceExt :: get_unchecked_mut ( self , index)
403403 }
404404
405- /// Returns an raw pointer to the slice's buffer
405+ /// Returns an raw pointer to the slice's buffer.
406406 ///
407407 /// The caller must ensure that the slice outlives the pointer this
408408 /// function returns, or else it will end up pointing to garbage.
@@ -468,7 +468,7 @@ impl<T> [T] {
468468 ///
469469 /// # Examples
470470 ///
471- /// ```rust
471+ /// ```
472472 /// let mut v = ["a", "b", "c", "d"];
473473 /// v.swap(1, 3);
474474 /// assert!(v == ["a", "d", "c", "b"]);
@@ -483,7 +483,7 @@ impl<T> [T] {
483483 ///
484484 /// # Example
485485 ///
486- /// ```rust
486+ /// ```
487487 /// let mut v = [1, 2, 3];
488488 /// v.reverse();
489489 /// assert!(v == [3, 2, 1]);
@@ -567,9 +567,9 @@ impl<T> [T] {
567567 }
568568
569569 /// Returns an iterator over `size` elements of the slice at a
570- /// time. The chunks are slices and do not overlap. If `size` does not divide the
571- /// length of the slice, then the last chunk will not have length
572- /// `size`.
570+ /// time. The chunks are slices and do not overlap. If `size` does
571+ /// not divide the length of the slice, then the last chunk will
572+ /// not have length `size`.
573573 ///
574574 /// # Panics
575575 ///
@@ -656,7 +656,7 @@ impl<T> [T] {
656656 ///
657657 /// # Examples
658658 ///
659- /// ```rust
659+ /// ```
660660 /// let mut v = [1, 2, 3, 4, 5, 6];
661661 ///
662662 /// // scoped to restrict the lifetime of the borrows
@@ -754,7 +754,7 @@ impl<T> [T] {
754754 }
755755
756756 /// Returns an iterator over subslices separated by elements that match
757- /// `pred`, limited to returning at most `n` items. The matched element is
757+ /// `pred`, limited to returning at most `n` items. The matched element is
758758 /// not contained in the subslices.
759759 ///
760760 /// The last element returned, if any, will contain the remainder of the
@@ -781,7 +781,7 @@ impl<T> [T] {
781781 }
782782
783783 /// Returns an iterator over subslices separated by elements that match
784- /// `pred`, limited to returning at most `n` items. The matched element is
784+ /// `pred`, limited to returning at most `n` items. The matched element is
785785 /// not contained in the subslices.
786786 ///
787787 /// The last element returned, if any, will contain the remainder of the
@@ -835,7 +835,7 @@ impl<T> [T] {
835835
836836 /// Returns an iterator over subslices separated by elements that match
837837 /// `pred` limited to returning at most `n` items. This starts at the end of
838- /// the slice and works backwards. The matched element is not contained in
838+ /// the slice and works backwards. The matched element is not contained in
839839 /// the subslices.
840840 ///
841841 /// The last element returned, if any, will contain the remainder of the
@@ -922,9 +922,9 @@ impl<T> [T] {
922922 ///
923923 /// Looks up a series of four elements. The first is found, with a
924924 /// uniquely determined position; the second and third are not
925- /// found; the fourth could match any position in `[1,4]`.
925+ /// found; the fourth could match any position in `[1, 4]`.
926926 ///
927- /// ```rust
927+ /// ```
928928 /// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
929929 ///
930930 /// assert_eq!(s.binary_search(&13), Ok(9));
@@ -956,9 +956,9 @@ impl<T> [T] {
956956 ///
957957 /// Looks up a series of four elements. The first is found, with a
958958 /// uniquely determined position; the second and third are not
959- /// found; the fourth could match any position in `[1,4]`.
959+ /// found; the fourth could match any position in `[1, 4]`.
960960 ///
961- /// ```rust
961+ /// ```
962962 /// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
963963 ///
964964 /// let seek = 13;
@@ -982,21 +982,23 @@ impl<T> [T] {
982982 /// Binary search a sorted slice with a key extraction function.
983983 ///
984984 /// Assumes that the slice is sorted by the key, for instance with
985- /// `sort_by_key` using the same key extraction function.
985+ /// [ `sort_by_key`] using the same key extraction function.
986986 ///
987987 /// If a matching value is found then returns `Ok`, containing the
988988 /// index for the matched element; if no match is found then `Err`
989989 /// is returned, containing the index where a matching element could
990990 /// be inserted while maintaining sorted order.
991991 ///
992+ /// [`sort_by_key`]: #method.sort_by_key
993+ ///
992994 /// # Examples
993995 ///
994996 /// Looks up a series of four elements in a slice of pairs sorted by
995997 /// their second elements. The first is found, with a uniquely
996998 /// determined position; the second and third are not found; the
997- /// fourth could match any position in `[1,4]`.
999+ /// fourth could match any position in `[1, 4]`.
9981000 ///
999- /// ```rust
1001+ /// ```
10001002 /// let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
10011003 /// (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
10021004 /// (1, 21), (2, 34), (4, 55)];
@@ -1023,7 +1025,7 @@ impl<T> [T] {
10231025 ///
10241026 /// # Examples
10251027 ///
1026- /// ```rust
1028+ /// ```
10271029 /// let mut v = [-5, 4, 1, -3, 2];
10281030 ///
10291031 /// v.sort();
@@ -1045,7 +1047,7 @@ impl<T> [T] {
10451047 ///
10461048 /// # Examples
10471049 ///
1048- /// ```rust
1050+ /// ```
10491051 /// let mut v = [-5i32, 4, 1, -3, 2];
10501052 ///
10511053 /// v.sort_by_key(|k| k.abs());
@@ -1067,7 +1069,7 @@ impl<T> [T] {
10671069 ///
10681070 /// # Examples
10691071 ///
1070- /// ```rust
1072+ /// ```
10711073 /// let mut v = [5, 4, 1, 3, 2];
10721074 /// v.sort_by(|a, b| a.cmp(b));
10731075 /// assert!(v == [1, 2, 3, 4, 5]);
@@ -1094,7 +1096,7 @@ impl<T> [T] {
10941096 ///
10951097 /// # Example
10961098 ///
1097- /// ```rust
1099+ /// ```
10981100 /// let mut dst = [0, 0, 0];
10991101 /// let src = [1, 2, 3];
11001102 ///
@@ -1116,7 +1118,7 @@ impl<T> [T] {
11161118 ///
11171119 /// # Example
11181120 ///
1119- /// ```rust
1121+ /// ```
11201122 /// let mut dst = [0, 0, 0];
11211123 /// let src = [1, 2, 3];
11221124 ///
0 commit comments