Skip to content

Commit

Permalink
borsh
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Jun 24, 2024
1 parent d715a3e commit 364316b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ default = []
nightly = []
serde = ["dep:serde", "serde-big-array"]
numtraits = ["num-integer", "num-traits"]
borsh = ["dep:borsh"]

[dependencies]
num-integer = { version = "0.1", optional = true, default-features = false }
Expand All @@ -34,6 +35,8 @@ quickcheck = { version = "1.0", optional = true, default-features = false }
valuable = { version = "0.1", optional = true, features = ["derive"], default-features = false }
# lit-parser = { path = "./lit-parser/", optional = true }

borsh = { version = "^1.5", optional = true, default-features = false, features = ["rc", "std", "unstable__schema"]}

[dev-dependencies]
quickcheck = "1.0"
paste = "1.0"
Expand Down
7 changes: 7 additions & 0 deletions src/buint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ use ::{
serde_big_array::BigArray,
};

#[cfg(feature = "borsh")]
use ::{
alloc::string::ToString,
borsh::{BorshDeserialize, BorshSchema, BorshSerialize},
};

use core::default::Default;

use core::iter::{Iterator, Product, Sum};
Expand All @@ -29,6 +35,7 @@ macro_rules! mod_impl {

#[derive(Clone, Copy, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize, BorshSchema))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "valuable", derive(valuable::Valuable))]
#[repr(transparent)]
Expand Down

0 comments on commit 364316b

Please sign in to comment.