Use NonZero* where applicable

This commit is contained in:
Adrian Heine 2023-03-08 11:46:47 +01:00
parent ac1c06dd31
commit 5045c3494d
4 changed files with 12 additions and 7 deletions

View file

@ -1,14 +1,16 @@
use crate::command_runner::CommandRunner;
use crate::symbols::Symbol;
use async_trait::async_trait;
use nonzero_ext::nonzero;
use std::error::Error;
use std::num::NonZeroU32;
use std::path::Path;
#[derive(Debug)]
pub struct Key<C, P> {
file_path: P,
command_runner: C,
bits: u32,
bits: NonZeroU32,
}
impl<C, P> Key<C, P> {
@ -16,7 +18,7 @@ impl<C, P> Key<C, P> {
Self {
file_path,
command_runner,
bits: 4096,
bits: nonzero!(4096u32), // FIXME: Policy
}
}
}