From 35c85d45674722cef184bb8e9bc6460c61686715 Mon Sep 17 00:00:00 2001 From: Inokentiy Babushkin Date: Wed, 7 Feb 2018 22:43:21 +0100 Subject: [PATCH] Implemented less strict version requirements for pre-1.0.0 versions. Closes #46. --- src/semcheck/changes.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/semcheck/changes.rs b/src/semcheck/changes.rs index 0397c816c2408..ba1fa269284a9 100644 --- a/src/semcheck/changes.rs +++ b/src/semcheck/changes.rs @@ -674,10 +674,14 @@ impl<'tcx> ChangeSet<'tcx> { /// Format the contents of a change set for user output. pub fn output(&self, session: &Session, version: &str, verbose: bool) { if let Ok(mut new_version) = Version::parse(version) { - match self.max { - Patch => new_version.increment_patch(), - NonBreaking | TechnicallyBreaking => new_version.increment_minor(), - Breaking => new_version.increment_major(), + if new_version.major == 0 { + new_version.increment_patch(); + } else { + match self.max { + Patch => new_version.increment_patch(), + NonBreaking | TechnicallyBreaking => new_version.increment_minor(), + Breaking => new_version.increment_major(), + } } println!("version bump: {} -> ({}) -> {}", version, self.max, new_version);