Fix env::is_totally_deprecated logic
we should fallback to comparing against min_cfg_version
if there's no version to compare with
@@ -42,13 +42,24 @@ impl Env {
deprecated_version: Option<Version>,
) -> bool {
let to_compare_with = self.config.min_required_version(self, ns_id);
- if let (Some(v), Some(to_compare_v)) = (deprecated_version, to_compare_with) {
+ match (deprecated_version, to_compare_with) {
+ (Some(v), Some(to_compare_v)) => {
if v <= to_compare_v {
- return self.config.deprecate_by_min_version;
+ self.config.deprecate_by_min_version
+ } else {
+ false
}
}
+ (Some(v), _) => {
+ if v <= self.config.min_cfg_version {
+ self.config.deprecate_by_min_version
+ } else {
false
}
+ }
+ _ => false,
+ }
+ }
pub fn is_too_low_version(&self, ns_id: Option<NsId>, version: Option<Version>) -> bool {
let to_compare_with = self.config.min_required_version(self, ns_id);
