pub struct CheckThresholds {
pub max_exact: Option<usize>,
pub max_near: Option<usize>,
pub max_exact_percent: Option<Threshold>,
pub max_near_percent: Option<Threshold>,
}Expand description
The four ceilings check measures a result against.
Every field is optional and an absent one is not a ceiling of zero – it
means the caller did not ask about that dimension, so nothing can breach
it. Default therefore describes a check that reports and never fails,
which is what running check with no flags does.
Fields§
§max_exact: Option<usize>Most exact-duplicate groups allowed.
max_near: Option<usize>Most near-duplicate groups allowed.
max_exact_percent: Option<Threshold>Largest share of lines allowed to be exact duplicates.
max_near_percent: Option<Threshold>Largest share of lines allowed to be near duplicates.
Implementations§
Source§impl CheckThresholds
impl CheckThresholds
Sourcepub fn new(
max_exact: Option<usize>,
max_near: Option<usize>,
max_exact_percent: Option<f64>,
max_near_percent: Option<f64>,
) -> Result<Self>
pub fn new( max_exact: Option<usize>, max_near: Option<usize>, max_exact_percent: Option<f64>, max_near_percent: Option<f64>, ) -> Result<Self>
Build the ceilings from what the command line asked for.
§Errors
Returns crate::error::Error::InvalidConfig naming the flag whose
value is not a share of a hundred.
Sourcepub const fn is_unbounded(&self) -> bool
pub const fn is_unbounded(&self) -> bool
Whether any ceiling was set at all.
A check with none set can still report, and still exits zero however
much duplication it finds.