Skip to content

Commit

Permalink
add more conversions for Value
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Jan 17, 2025
1 parent 42c0e4a commit 86b836b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "baa"
version = "0.16.4"
version = "0.16.5"
edition = "2021"
authors = ["Kevin Laeufer <[email protected]>"]
description = "BitVector and Array Arithmetic"
Expand Down
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ impl TryFrom<Value> for u64 {
}
}

impl From<BitVecValue> for Value {
fn from(value: BitVecValue) -> Self {
Self::BitVec(value)
}
}

impl From<ArrayValue> for Value {
fn from(value: ArrayValue) -> Self {
Self::Array(value)
}
}

impl Value {
pub fn try_into_u64(self) -> Result<u64, ()> {
<Self as TryInto<u64>>::try_into(self)
Expand Down

0 comments on commit 86b836b

Please sign in to comment.