cl-interpret/convalue: Destructure with (Rust) pattern matching

This commit is contained in:
John 2025-02-28 20:36:24 -06:00
parent fd54b513be
commit c0ad544486

View File

@ -166,9 +166,9 @@ impl From<()> for ConValue {
}
impl From<&[ConValue]> for ConValue {
fn from(value: &[ConValue]) -> Self {
match value.len() {
0 => Self::Empty,
1 => value[0].clone(),
match value {
[] => Self::Empty,
[value] => value.clone(),
_ => Self::Tuple(value.into()),
}
}