Add Value byte size assertion

This commit is contained in:
Ian Manske 2024-04-22 18:52:23 -04:00
parent 84ba4bfa94
commit 361e4797d5

View File

@ -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::<Value>() <= 56);
impl Value { impl Value {
fn cant_convert_to<T>(&self, typ: &str) -> Result<T, ShellError> { fn cant_convert_to<T>(&self, typ: &str) -> Result<T, ShellError> {
Err(ShellError::CantConvert { Err(ShellError::CantConvert {