use semver::Version;
#[derive(Debug, Clone)]
pub struct OsvRange {
pub introduced: Option<Version>,
pub fixed: Option<Version>,
}
impl OsvRange {
pub fn affects(&self, v: &Version) -> bool {
(match &self.introduced {
None => true,
Some(start_v) => v >= start_v,
}) && (match &self.fixed {
None => true,
Some(end_v) => v < end_v,
})
}
}