aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/basalt.rs3
-rw-r--r--src/peering/basalt.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/basalt.rs b/examples/basalt.rs
index a5a25c3..22a44b5 100644
--- a/examples/basalt.rs
+++ b/examples/basalt.rs
@@ -1,4 +1,5 @@
use std::io::Write;
+use std::num::NonZeroUsize;
use std::sync::Arc;
use std::time::Duration;
@@ -41,7 +42,7 @@ pub struct Opt {
view_size: usize,
#[structopt(long = "cache-size", short = "c", default_value = "1000")]
- cache_size: usize,
+ cache_size: NonZeroUsize,
#[structopt(long = "exchange-interval-secs", short = "x", default_value = "1")]
exchange_interval: u64,
diff --git a/src/peering/basalt.rs b/src/peering/basalt.rs
index 2c27dba..21506a7 100644
--- a/src/peering/basalt.rs
+++ b/src/peering/basalt.rs
@@ -1,5 +1,6 @@
use std::collections::HashSet;
use std::net::SocketAddr;
+use std::num::NonZeroUsize;
use std::sync::{Arc, RwLock};
use std::time::Duration;
@@ -229,7 +230,7 @@ impl BasaltView {
pub struct BasaltParams {
pub view_size: usize,
- pub cache_size: usize,
+ pub cache_size: NonZeroUsize,
pub exchange_interval: Duration,
pub reset_interval: Duration,
pub reset_count: usize,