rust-semver-Add-increment-foo-again.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From 3e0730d1d892f9d085199f0ea4f66cea37e15939 Mon Sep 17 00:00:00 2001
  2. From: Maxime Devos <maximedevos@telenet.be>
  3. Date: Thu, 23 Jun 2022 21:25:15 +0000
  4. Subject: [PATCH] =?UTF-8?q?Re-instate=20=E2=80=98Initial=20implementation?=
  5. =?UTF-8?q?=20of=20self-incrementing=20version=20numbers.=E2=80=99?=
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. This unreverts the commit:
  10. commit 860caa20d7e1b939cbf3b7ca0a923f2c51293906
  11. Author: Cruz Julian Bishop <cruzjbishop@gmail.com>
  12. Date: Sun Jun 14 09:41:25 2015 +1000
  13. Initial implementation of self-incrementing version numbers.
  14. which is still used by rust-nu-plugin-inc.
  15. ---
  16. src/lib.rs | 23 +++++++++++++++++++++++
  17. 1 file changed, 23 insertions(+)
  18. diff --git a/src/lib.rs b/src/lib.rs
  19. index f1e1776..37ffb85 100644
  20. --- a/src/lib.rs
  21. +++ b/src/lib.rs
  22. @@ -431,6 +431,29 @@ impl Version {
  23. pub fn parse(text: &str) -> Result<Self, Error> {
  24. Version::from_str(text)
  25. }
  26. +
  27. +
  28. + ///Increments the patch number for this Version (Must be mutable)
  29. + pub fn increment_patch(&mut self) {
  30. + self.patch += 1;
  31. + }
  32. +
  33. + ///Increments the minor version number for this Version (Must be mutable)
  34. + ///
  35. + ///As instructed by section 7 of the spec, the patch number is reset to 0.
  36. + pub fn increment_minor(&mut self) {
  37. + self.minor += 1;
  38. + self.patch = 0;
  39. + }
  40. +
  41. + ///Increments the major version number for this Version (Must be mutable)
  42. + ///
  43. + ///As instructed by section 8 of the spec, the minor and patch numbers are reset to 0
  44. + pub fn increment_major(&mut self) {
  45. + self.major += 1;
  46. + self.minor = 0;
  47. + self.patch = 0;
  48. + }
  49. }
  50. impl VersionReq {
  51. base-commit: ce0ab4d7a525d2f81e393ef10250192175b0569d
  52. --
  53. 2.36.1