Constify slice flatten method
This commit is contained in:
parent
4b87ed9d0f
commit
4fec8a35b6
@ -4257,7 +4257,7 @@ impl<T, const N: usize> [[T; N]] {
|
||||
/// assert!(empty_slice_of_arrays.flatten().is_empty());
|
||||
/// ```
|
||||
#[unstable(feature = "slice_flatten", issue = "95629")]
|
||||
pub fn flatten(&self) -> &[T] {
|
||||
pub const fn flatten(&self) -> &[T] {
|
||||
let len = if T::IS_ZST {
|
||||
self.len().checked_mul(N).expect("slice len overflow")
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user