Skip to content

Commit

Permalink
Constify slice flatten method
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilaBorowska committed May 3, 2023
1 parent 4b87ed9 commit 4fec8a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/slice/mod.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 4fec8a3

Please sign in to comment.