Performs a major version bump increment on the semver version `version`. This function will perform a semver-major-version bump on the `version` specified. This is used to calculate the next version of a crate in this repository since we're currently making major version bumps for all our releases. This may end up getting tweaked as we stabilize crates and start doing more minor/patch releases, b
(version: &str, patch_bump: bool)
| 417 | /// releases. This may end up getting tweaked as we stabilize crates and start |
| 418 | /// doing more minor/patch releases, but for now this should do the trick. |
| 419 | fn bump(version: &str, patch_bump: bool) -> String { |
| 420 | let mut iter = version.split('.').map(|s| s.parse::<u32>().unwrap()); |
| 421 | let major = iter.next().expect("major version"); |
| 422 | let minor = iter.next().expect("minor version"); |
| 423 | let patch = iter.next().expect("patch version"); |
| 424 | |
| 425 | if patch_bump { |
| 426 | return format!("{}.{}.{}", major, minor, patch + 1); |
| 427 | } |
| 428 | if major != 0 { |
| 429 | format!("{}.0.0", major + 1) |
| 430 | } else if minor != 0 { |
| 431 | format!("0.{}.0", minor + 1) |
| 432 | } else { |
| 433 | format!("0.0.{}", patch + 1) |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | fn publish(krate: &Crate) -> bool { |
| 438 | if !krate.publish { |
no test coverage detected