From 4fec8a35b647e8905a4ea8093002e3afe4b9b4e1 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Wed, 3 May 2023 12:33:15 +0200 Subject: [PATCH] Constify slice flatten method --- library/core/src/slice/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 33a468a6bca57..d4981af90d19e 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -4257,7 +4257,7 @@ impl [[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 {