@@ -4533,21 +4533,21 @@ impl<T, const N: usize> [[T; N]] {
4533
4533
/// ```
4534
4534
/// #![feature(slice_flatten)]
4535
4535
///
4536
- /// assert_eq!([[1, 2, 3], [4, 5, 6]].flatten (), &[1, 2, 3, 4, 5, 6]);
4536
+ /// assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened (), &[1, 2, 3, 4, 5, 6]);
4537
4537
///
4538
4538
/// assert_eq!(
4539
- /// [[1, 2, 3], [4, 5, 6]].flatten (),
4540
- /// [[1, 2], [3, 4], [5, 6]].flatten (),
4539
+ /// [[1, 2, 3], [4, 5, 6]].as_flattened (),
4540
+ /// [[1, 2], [3, 4], [5, 6]].as_flattened (),
4541
4541
/// );
4542
4542
///
4543
4543
/// let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
4544
- /// assert!(slice_of_empty_arrays.flatten ().is_empty());
4544
+ /// assert!(slice_of_empty_arrays.as_flattened ().is_empty());
4545
4545
///
4546
4546
/// let empty_slice_of_arrays: &[[u32; 10]] = &[];
4547
- /// assert!(empty_slice_of_arrays.flatten ().is_empty());
4547
+ /// assert!(empty_slice_of_arrays.as_flattened ().is_empty());
4548
4548
/// ```
4549
4549
#[ unstable( feature = "slice_flatten" , issue = "95629" ) ]
4550
- pub const fn flatten ( & self ) -> & [ T ] {
4550
+ pub const fn as_flattened ( & self ) -> & [ T ] {
4551
4551
let len = if T :: IS_ZST {
4552
4552
self . len ( ) . checked_mul ( N ) . expect ( "slice len overflow" )
4553
4553
} else {
@@ -4581,11 +4581,11 @@ impl<T, const N: usize> [[T; N]] {
4581
4581
/// }
4582
4582
///
4583
4583
/// let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
4584
- /// add_5_to_all(array.flatten_mut ());
4584
+ /// add_5_to_all(array.as_flattened_mut ());
4585
4585
/// assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
4586
4586
/// ```
4587
4587
#[ unstable( feature = "slice_flatten" , issue = "95629" ) ]
4588
- pub fn flatten_mut ( & mut self ) -> & mut [ T ] {
4588
+ pub fn as_flattened_mut ( & mut self ) -> & mut [ T ] {
4589
4589
let len = if T :: IS_ZST {
4590
4590
self . len ( ) . checked_mul ( N ) . expect ( "slice len overflow" )
4591
4591
} else {
0 commit comments