mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
Switch from Rust 2021 to Rust 2024. See <https://doc.rust-lang.org/edition-guide/rust-2024/>. Regarding the added bound `use<>`, see <https://blog.rust-lang.org/2024/09/05/impl-trait-capture-rules/>.
19 lines
539 B
Rust
19 lines
539 B
Rust
use std::num::NonZeroUsize;
|
|
|
|
use radicle::test::arbitrary;
|
|
|
|
use crate::fetcher::{Config, MaxQueueSize, RefsToFetch};
|
|
|
|
pub fn config(max_concurrency: usize, max_queue_size: usize) -> Config {
|
|
Config::new()
|
|
.with_max_concurrency(NonZeroUsize::new(max_concurrency).unwrap())
|
|
.with_max_capacity(MaxQueueSize::new(
|
|
NonZeroUsize::new(max_queue_size).unwrap(),
|
|
))
|
|
}
|
|
|
|
pub fn gen_refs(count: usize) -> RefsToFetch {
|
|
let refs: Vec<_> = (0..count).map(|_| arbitrary::r#gen(1)).collect();
|
|
refs.into()
|
|
}
|