From 68dd72ec5514e9be6afb400d3052273f26702994 Mon Sep 17 00:00:00 2001 From: Abraham Egnor Date: Wed, 27 Aug 2025 15:09:45 +0100 Subject: [PATCH] minor: const array bson conversion --- src/bson.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bson.rs b/src/bson.rs index 12e04958..b53bfdc1 100644 --- a/src/bson.rs +++ b/src/bson.rs @@ -349,6 +349,15 @@ impl, S> From> for Bson { } } +impl From<[T; N]> for Bson +where + T: Into, +{ + fn from(value: [T; N]) -> Self { + Bson::Array(value.into_iter().map(|v| v.into()).collect()) + } +} + impl From<&[T]> for Bson where T: Clone + Into,