Skip to content

Commit

Permalink
add from_str_radix for owned
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Sep 16, 2024
1 parent 4f633e4 commit cf86c66
Show file tree
Hide file tree
Showing 2 changed files with 7 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.7.5"
version = "0.7.6"
edition = "2021"
authors = ["Kevin Laeufer <[email protected]>"]
description = "BitVector and Array Arithmetic"
Expand Down
6 changes: 6 additions & 0 deletions src/value/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ impl BitVecValue {
out
}

pub fn from_radix_str(value: &str, width: WidthInt) -> Self {
let mut out = Self::zero(width);
out.assign_from_str_radix(value, 2).unwrap();
out
}

pub fn from_u64(value: u64, width: WidthInt) -> Self {
let mut out = Self::zero(width);
out.assign_from_u64(value);
Expand Down

0 comments on commit cf86c66

Please sign in to comment.