|
20 | 20 | //! let next = Sem::next_version_string( |
21 | 21 | //! "<MAJOR>.<MINOR>.<PATCH>", // format string |
22 | 22 | //! "1.2.3", // current version string |
23 | | -//! SemLevel::Minor // the specifier to increment |
| 23 | +//! SemLevel::Minor // the specifier to increment |
24 | 24 | //! )?; |
25 | 25 | //! assert_eq!(next, "1.3.0"); |
26 | 26 | //! # Ok::<(), Box<dyn std::error::Error>>(()) |
|
29 | 29 | //! ``` |
30 | 30 | //! use nextver::prelude::*; |
31 | 31 | //! |
32 | | -//! let date = Date::utc_now(); // assume today is 2024-02-23 |
| 32 | +//! let date = Date::utc_now(); // assume today is 2024-02-23 |
33 | 33 | //! # let date = Date::explicit(2024, 2, 23)?; |
34 | 34 | //! |
35 | 35 | //! let next = CalSem::next_version_string( |
36 | | -//! "<YYYY>.<0M>-<PATCH>", // format string |
37 | | -//! "2023.12-42", // current version string |
38 | | -//! date, // the date to update to |
39 | | -//! CalSemLevel::Patch // the specifier to increment if no calendar update |
| 36 | +//! "<YYYY>.<0M>-<PATCH>", // format string |
| 37 | +//! "2023.12-42", // current version string |
| 38 | +//! date, // the date to update to |
| 39 | +//! CalSemLevel::Patch // the specifier to increment if no calendar update |
40 | 40 | //! )?; |
41 | 41 | //! assert_eq!(next, "2024.02-0"); |
42 | 42 | //! # Ok::<(), Box<dyn std::error::Error>>(()) |
|
54 | 54 | //! let cur = format.new_version("2023.12.42")?; |
55 | 55 | //! let next = cur.next(date, CalSemLevel::Patch)?; |
56 | 56 | //! assert_eq!(next.to_string(), "2024.2.0"); |
57 | | -//! // comparisons are also possible with Version objects |
| 57 | +//! // the next version will be compare as greater than the current |
58 | 58 | //! assert!(next > cur); |
59 | 59 | //! # Ok::<(), Box<dyn std::error::Error>>(()) |
60 | 60 | //! ``` |
|
0 commit comments