From fde2ba10212ab3a0fd61970ad535e5e21ef984e5 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:09:06 +0100 Subject: [PATCH] fix: correctly (de)serialize workspace specifiers versions --- CHANGELOG.md | 1 + src/source/workspace/specifier.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e4b385..9b49f9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/source/workspace/specifier.rs b/src/source/workspace/specifier.rs index 5fb1625..995348f 100644 --- a/src/source/workspace/specifier.rs +++ b/src/source/workspace/specifier.rs @@ -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, @@ -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),