mirror of
https://github.com/nushell/nushell.git
synced 2025-04-02 20:27:11 +02:00
Add compile-time assertion of Value
's size (#15362)
# Description Adds an assertion of `Value`'s size, similar to `Instruction` and `Expr`.
This commit is contained in:
parent
2c7ab6e898
commit
69d1c8e948
@ -168,6 +168,11 @@ pub enum 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>() <= 48);
|
||||
|
||||
impl Clone for Value {
|
||||
fn clone(&self) -> Self {
|
||||
match self {
|
||||
|
Loading…
Reference in New Issue
Block a user