pub fn declared_impact(from: Version, to: Version) -> ImpactExpand description
The bump two version numbers already represent.
A number going down is not a bump at all, and is reported as Impact::None so that
the comparison with the requirement refuses it rather than ranking it.
use majordomus_cli::release::compat::{declared_impact, Impact};
use majordomus_cli::release::version::Version;
let v = |s| Version::parse(s).unwrap();
assert_eq!(declared_impact(v("0.5.0"), v("0.6.0")), Impact::Minor);
assert_eq!(declared_impact(v("0.5.0"), v("1.0.0")), Impact::Major);
// A version going down is no bump at all, so it can never satisfy a requirement.
assert_eq!(declared_impact(v("0.5.0"), v("0.4.0")), Impact::None);