From 361e4797d5a873afe4629f5f6b336c1b5a368eb0 Mon Sep 17 00:00:00 2001 From: Ian Manske Date: Mon, 22 Apr 2024 18:52:23 -0400 Subject: [PATCH] Add `Value` byte size assertion --- crates/nu-protocol/src/value/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index c345886b60..6c68639b4c 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -247,6 +247,11 @@ impl Clone for Value { } } +// This is to document/enforce the size of `Value` in bytes. +// We should try to avoid increasing the size of `Value`, +// and PRs that do so will have to change the number below so that it's noted in review. +const _: () = assert!(std::mem::size_of::() <= 56); + impl Value { fn cant_convert_to(&self, typ: &str) -> Result { Err(ShellError::CantConvert {