From a55e78a28dee7890afb84d1a2ad90f28df9b57e7 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 28 Feb 2024 13:19:43 +1100 Subject: [PATCH] internals: Implement Default for ArrayVec In an unrelated PR CI run we got the following error: ``` error: you should consider adding a `Default` implementation for `ArrayVec` ``` I did not bother to dig any deeper since this seems like a reasonable suggestion by the compiler since we provide a `new` function that takes zero arguments. Add a `Default` implementation to `ArrayVec`. --- internals/src/array_vec.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internals/src/array_vec.rs b/internals/src/array_vec.rs index 17dddd37..40e54f4f 100644 --- a/internals/src/array_vec.rs +++ b/internals/src/array_vec.rs @@ -95,6 +95,10 @@ mod safety_boundary { } } +impl Default for ArrayVec { + fn default() -> Self { Self::new() } +} + /// Clones the value *faster* than using `Copy`. /// /// Because we avoid copying the uninitialized part of the array this copies the value faster than