mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
peer_id: make quickcheck optional but default feature
This commit is contained in:
parent
bbfe54670a
commit
32aa34366c
2 changed files with 6 additions and 1 deletions
|
|
@ -12,9 +12,12 @@ rust-version.workspace = true
|
||||||
[lib]
|
[lib]
|
||||||
name = "aquatic_peer_id"
|
name = "aquatic_peer_id"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["quickcheck"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
compact_str = "0.7"
|
compact_str = "0.7"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
quickcheck = "1"
|
quickcheck = { version = "1", optional = true }
|
||||||
|
|
@ -195,6 +195,7 @@ impl Display for PeerClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "quickcheck")]
|
||||||
impl quickcheck::Arbitrary for PeerId {
|
impl quickcheck::Arbitrary for PeerId {
|
||||||
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
|
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
|
||||||
let mut bytes = [0u8; 20];
|
let mut bytes = [0u8; 20];
|
||||||
|
|
@ -207,6 +208,7 @@ impl quickcheck::Arbitrary for PeerId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "quickcheck")]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue