From 3a7d2bc8368f34847104cf4393386b008a1c8ce1 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Tue, 22 Nov 2022 12:21:33 +0000 Subject: [PATCH] Fix VersionMap no longer being Send+Sync I overlooked that e00a8b52997a1bbb6c9baf35154feefed2c47076 was not part of 0.1.6 and introduced a breaking change, as the `dyn VersionFilter` field prevented `VersionMap` from being sharable between threads. As this was previously the case, this meant a breaking change snuck into a patch release, so 0.1.7 was yanked and instead we need to release 0.1.8 Signed-off-by: Patrick Roy --- Cargo.toml | 2 +- src/version_map.rs | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cf6f525..8ebbead 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "versionize" -version = "0.1.7" +version = "0.1.8" license = "Apache-2.0" authors = ["Amazon Firecracker team "] description = "A version tolerant serialization/deserialization framework." diff --git a/src/version_map.rs b/src/version_map.rs index 2f267ec..7fbc56e 100644 --- a/src/version_map.rs +++ b/src/version_map.rs @@ -83,7 +83,7 @@ impl VersionFilter for () { #[derive(Clone, Debug)] pub struct VersionMap { versions: Vec>, - filter: Arc, + filter: Arc, } impl Default for VersionMap { @@ -102,7 +102,7 @@ impl VersionMap { } /// Create a new version map with specified version filter. - pub fn with_filter(filter: Arc) -> Self { + pub fn with_filter(filter: Arc) -> Self { VersionMap { versions: vec![HashMap::new(); 1], filter, @@ -220,6 +220,13 @@ mod tests { } } + #[test] + fn test_version_map_is_send_and_sync() { + fn assert_send_sync() {} + + assert_send_sync::(); + } + #[test] fn test_app_versions_with_gap() { let my_type_id = TypeId::of::();