-impl Feature {
- fn check_match(&self, other: &Feature)-> Result<(), Vec<&'static str>> {
- let mut mismatches = Vec::new();
- if self.level != other.level {
- mismatches.push("stability level");
- }
- if self.level == Status::Stable || other.level == Status::Stable {
- // As long as a feature is unstable, the since field tracks
- // when the given part of the feature has been implemented.
- // Mismatches are tolerable as features evolve and functionality
- // gets added.
- // Once a feature is stable, the since field tracks the first version
- // it was part of the stable distribution, and mismatches are disallowed.
- if self.since != other.since {
- mismatches.push("since");
- }
- }
- if self.tracking_issue != other.tracking_issue {
- mismatches.push("tracking issue");
- }
- if mismatches.is_empty() {
- Ok(())
- } else {
- Err(mismatches)
- }
- }
-}
-