diff options
| author | Konrad Borowski <konrad@borowski.pw> | 2023-05-03 12:33:15 +0200 |
|---|---|---|
| committer | Konrad Borowski <konrad@borowski.pw> | 2023-05-03 12:33:15 +0200 |
| commit | 4fec8a35b647e8905a4ea8093002e3afe4b9b4e1 (patch) | |
| tree | 76c8bf960ad31ceb774747e90c62194c6c85a0b8 | |
| parent | 4b87ed9d0f18166a26aadb5289bac004e058b90f (diff) | |
| download | rust-4fec8a35b647e8905a4ea8093002e3afe4b9b4e1.tar.gz rust-4fec8a35b647e8905a4ea8093002e3afe4b9b4e1.zip | |
Constify slice flatten method
| -rw-r--r-- | library/core/src/slice/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 33a468a6bca..d4981af90d1 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -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 { |
