{"id":16677470,"url":"https://github.com/foresterre/version-number","last_synced_at":"2026-02-22T00:03:46.694Z","repository":{"id":40310589,"uuid":"486763595","full_name":"foresterre/version-number","owner":"foresterre","description":"🔢 Two and three component version number parsing ~ Major Minor (Patch) ","archived":false,"fork":false,"pushed_at":"2025-12-02T16:04:16.000Z","size":132,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T07:44:59.183Z","etag":null,"topics":["cargo","hacktoberfest","metadata","parsing","rust","rustup"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foresterre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["foresterre"],"buy_me_a_coffee":"foresterre","thanks_dev":"u/gh/foresterre"}},"created_at":"2022-04-28T22:16:18.000Z","updated_at":"2024-12-10T22:31:14.000Z","dependencies_parsed_at":"2024-04-25T15:26:07.064Z","dependency_job_id":"4bbf457f-9694-4b0c-afb8-6672da1900f6","html_url":"https://github.com/foresterre/version-number","commit_stats":{"total_commits":79,"total_committers":2,"mean_commits":39.5,"dds":"0.025316455696202556","last_synced_commit":"6db66193a255c1e778bafae24489dc313904c99b"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/foresterre/version-number","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foresterre%2Fversion-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foresterre%2Fversion-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foresterre%2Fversion-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foresterre%2Fversion-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foresterre","download_url":"https://codeload.github.com/foresterre/version-number/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foresterre%2Fversion-number/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29699352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T23:35:04.139Z","status":"ssl_error","status_checked_at":"2026-02-21T23:35:03.832Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","hacktoberfest","metadata","parsing","rust","rustup"],"created_at":"2024-10-12T13:26:32.488Z","updated_at":"2026-02-22T00:03:46.678Z","avatar_url":"https://github.com/foresterre.png","language":"Rust","funding_links":["https://github.com/sponsors/foresterre","https://buymeacoffee.com/foresterre","https://thanks.dev/u/gh/foresterre"],"categories":[],"sub_categories":[],"readme":"# version-number\n\n_Parsing the \"version core\" of semver numbers and their shorthands_\n\n### Introduction\n\nA crate to parse two- and three component version numbers. The three component version numbers are a subset of\nsemver, namely, just the \"version core\" of a semver version (that is, pre-release and/or build modifiers are not\nsupported).\nTwo component versions are a shorthand of the three component version number, where the patch number is not specified.\n\nExamples of two- respectively three component version numbers are `1.51` and `1.7.0`.\n\nAn example where this version type is found, is the `package.rust-version` field in the Cargo manifest (which crate\nauthors use\nto set the MSRV).\n\nWe call a two component `major.minor` version number, such as `1.51`, a **Base Version**, and a three component\n`major.minor.patch` version number, such as `1.7.0`, a **Full Version**.\n\n### Add as a dependency\n\nTo add `version-number` as a dependency to your Rust project, you may run  `cargo add version-number`.\n\nAlternatively, you could add the `version-number` crate manually to your Cargo manifest (i.e. `Cargo.toml`) as a\ndependency:\n\n```toml\n[dependencies]\nversion-number = \"0.3\"\n```\n\n### Usage\n\n```rust\nuse version_number::{BaseVersion, FullVersion, Version};\n\nfn main() {\n    let base = Version::parse(\"1.27\").unwrap();\n    assert_eq!(base, Version::Base(BaseVersion::new(1, 27)));\n\n    let full = Version::parse(\"1.27.0\").unwrap();\n    assert_eq!(full, Version::Full(FullVersion::new(1, 27, 0)));\n}\n```\n\nIf you only want to parse a two or three component version (and reject the other one), you may instead do:\n\n```rust\nuse version_number::{BaseVersion, FullVersion};\n\nfn main() {\n    let base = BaseVersion::parse(\"1.27\").unwrap();\n    assert_eq!(base, BaseVersion::new(1, 27));\n\n    let full = FullVersion::parse(\"1.27.0\").unwrap();\n    assert_eq!(full, FullVersion::new(1, 27, 0));\n}\n```\n\nPlease refer to the [docs](https://docs.rs/version-number) to review all functionality.\n\n### License\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n#### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally\nsubmitted for inclusion in the work by you, as defined in the Apache-2.0\nlicense, shall be dual licensed as above, without any additional terms or\nconditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforesterre%2Fversion-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforesterre%2Fversion-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforesterre%2Fversion-number/lists"}