dtolnay / semver

Parser and evaluator for Cargo's flavor of Semantic Versioning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`is_exact`?

smoelius opened this issue · comments

Semver 0.11.0's VersionReq had an is_exact method:

pub fn is_exact(&self) -> bool {

But the latest version's VersionReq doesn't seem to have this method.

Is there some way to accomplish what that method did that I am missing?

Something like this should work:

req.comparators.len() == 1 && {
    let cmp = &req.comparators[0];
    cmp.op == Op::Exact && cmp.minor.is_some() && cmp.patch.is_some()
}