Skip to content

Commit 4fec8a3

Browse files
Constify slice flatten method
1 parent 4b87ed9 commit 4fec8a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/slice/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4257,7 +4257,7 @@ impl<T, const N: usize> [[T; N]] {
42574257
/// assert!(empty_slice_of_arrays.flatten().is_empty());
42584258
/// ```
42594259
#[unstable(feature = "slice_flatten", issue = "95629")]
4260-
pub fn flatten(&self) -> &[T] {
4260+
pub const fn flatten(&self) -> &[T] {
42614261
let len = if T::IS_ZST {
42624262
self.len().checked_mul(N).expect("slice len overflow")
42634263
} else {

0 commit comments

Comments
 (0)