fix: correctly (de)serialize workspace specifiers versions

This commit is contained in:
daimond113 2024-11-03 13:09:06 +01:00
parent 620777cacf
commit fde2ba1021
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 3 additions and 2 deletions

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Use a different algorithm for finding a CAS directory to avoid issues with mounted drives by @daimond113
- Remove default.project.json from Git pesde dependencies by @daimond113
- Correctly (de)serialize workspace specifiers by @daimond113
### Changed
- Switched to fs-err for better errors with file system operations by @daimond113

View file

@ -10,7 +10,7 @@ pub struct WorkspaceDependencySpecifier {
#[serde(rename = "workspace")]
pub name: PackageName,
/// The version type to use when publishing the package
#[serde(default, rename = "version")]
#[serde(default)]
pub version: VersionTypeOrReq,
/// The target of the workspace package
pub target: Option<TargetKind>,
@ -67,7 +67,7 @@ impl FromStr for VersionType {
}
/// Either a version type or a version requirement
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, SerializeDisplay, DeserializeFromStr, Clone, PartialEq, Eq, Hash)]
pub enum VersionTypeOrReq {
/// A version type
VersionType(VersionType),