-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change type of Package.rust_version from VersionReq to Version
As per the Cargo Book[1] the `rust-version` must: > be a bare version number with two or three components; > it cannot include semver operators or pre-release identifiers. VersionReq therefore obviously is the wrong type since it describes[2]: > the intersection of some version comparators such as `>=1.2.3, <1.8` It doesn't make much sense to deserialize strings that explicitly "cannot include semver operators" as a vector of comparison operators. While the Version type's Deserialize implementation requires three components, we can just use a custom deserialize function to deserialize 1.2 as 1.2.0. This commit introduces such. [1]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field [2]: https://docs.rs/semver/1.0.7/semver/struct.VersionReq.html
- Loading branch information
1 parent
14a8b64
commit 535ab32
Showing
5 changed files
with
93 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "bare-rust-version" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.60" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters