diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index d890c7f13d3a7a..b2887c5f1d4923 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -3099,7 +3099,7 @@ mod tests { }, }; const DEFAULT_NUM_QUIC_ENDPOINTS: NonZeroUsize = - unsafe { NonZeroUsize::new_unchecked(DEFAULT_QUIC_ENDPOINTS) }; + NonZeroUsize::new(DEFAULT_QUIC_ENDPOINTS).unwrap(); impl ClusterInfo { // Wrapper for ClusterInfo.new_pull_requests replicating old return