cl-interpret/convalue: Destructure with (Rust) pattern matching
This commit is contained in:
parent
fd54b513be
commit
c0ad544486
@ -166,9 +166,9 @@ impl From<()> for ConValue {
|
|||||||
}
|
}
|
||||||
impl From<&[ConValue]> for ConValue {
|
impl From<&[ConValue]> for ConValue {
|
||||||
fn from(value: &[ConValue]) -> Self {
|
fn from(value: &[ConValue]) -> Self {
|
||||||
match value.len() {
|
match value {
|
||||||
0 => Self::Empty,
|
[] => Self::Empty,
|
||||||
1 => value[0].clone(),
|
[value] => value.clone(),
|
||||||
_ => Self::Tuple(value.into()),
|
_ => Self::Tuple(value.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user