From b6724144116cda0464e3aecb2916e470d337e366 Mon Sep 17 00:00:00 2001 From: schvv31n Date: Mon, 3 Jun 2024 11:17:56 +0100 Subject: [PATCH 1/4] restrict indexmap dep to v2 only --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 274ac0e..6651384 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ derive = ["implicit-clone-derive"] [dependencies] implicit-clone-derive = { version = "0.1", optional = true, path = "./implicit-clone-derive" } -indexmap = { version = ">= 1, <= 2", optional = true } +indexmap = { version = "2", optional = true } serde = { version = "1", optional = true } [dev-dependencies] From c4eb14c1073dc7cca9778d539f14434982f1766f Mon Sep 17 00:00:00 2001 From: schvv31n Date: Mon, 3 Jun 2024 11:30:51 +0100 Subject: [PATCH 2/4] raise minimum indexmap version in the CI --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a1f326a..e944cdb 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,7 +23,7 @@ jobs: - stable - 1.64.0 indexmap: - - 1.9.3 + - 2.0.0 - latest include: - os: ubuntu-latest From a554ab8f2f7d9f62ef595703183d398d2a64d8a6 Mon Sep 17 00:00:00 2001 From: schvv31n Date: Mon, 3 Jun 2024 12:55:33 +0100 Subject: [PATCH 3/4] fix tests --- .github/workflows/rust.yml | 8 -------- src/lib.rs | 1 + src/map.rs | 20 ++++++++++---------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e944cdb..1724bbc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,9 +22,6 @@ jobs: rust: - stable - 1.64.0 - indexmap: - - 2.0.0 - - latest include: - os: ubuntu-latest rust: stable @@ -44,11 +41,6 @@ jobs: default: true override: true - - name: Change indexmap version - if: matrix.indexmap != 'latest' - run: | - cargo update -p indexmap --precise ${{ matrix.indexmap }} - - name: cargo test uses: actions-rs/cargo@v1 with: diff --git a/src/lib.rs b/src/lib.rs index c2141db..28777ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -264,6 +264,7 @@ mod test { #[test] fn custom() { #[derive(Clone)] + #[allow(dead_code)] struct ImplicitCloneType; impl ImplicitClone for ImplicitCloneType {} diff --git a/src/map.rs b/src/map.rs index 85c2cc7..b59b9ee 100644 --- a/src/map.rs +++ b/src/map.rs @@ -162,10 +162,10 @@ impl(&self, key: &Q) -> Option + pub fn get(&self, key: &Q) -> Option where K: Borrow, - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, { match self { Self::Static(a) => a @@ -181,10 +181,10 @@ impl(&self, key: &Q) -> Option<(K, V)> + pub fn get_key_value(&self, key: &Q) -> Option<(K, V)> where K: Borrow, - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, { match self { Self::Static(a) => a.iter().find(|(k, _)| k.borrow() == key).cloned(), @@ -194,10 +194,10 @@ impl(&self, key: &Q) -> Option<(usize, K, V)> + pub fn get_full(&self, key: &Q) -> Option<(usize, K, V)> where K: Borrow, - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, { match self { Self::Static(a) => a @@ -225,10 +225,10 @@ impl(&self, key: &Q) -> Option + pub fn get_index_of(&self, key: &Q) -> Option where K: Borrow, - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, { match self { Self::Static(a) => a @@ -243,10 +243,10 @@ impl(&self, key: &Q) -> bool + pub fn contains_key(&self, key: &Q) -> bool where K: Borrow, - Q: Hash + Eq, + Q: Hash + Eq + ?Sized, { match self { Self::Static(a) => a.iter().any(|(k, _)| k.borrow() == key), From 9be4436b33894a87da992f1131a36f0fd8f24f68 Mon Sep 17 00:00:00 2001 From: schvv31n Date: Mon, 3 Jun 2024 13:55:32 +0100 Subject: [PATCH 4/4] pinned the version of trybuild to respect MSRV --- implicit-clone-derive/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implicit-clone-derive/Cargo.toml b/implicit-clone-derive/Cargo.toml index 10f11f0..3d09c49 100644 --- a/implicit-clone-derive/Cargo.toml +++ b/implicit-clone-derive/Cargo.toml @@ -21,5 +21,5 @@ syn = { version = "2", features = ["full"] } [dev-dependencies] implicit-clone = { path = ".." } -trybuild = "1" +trybuild = "=1.0.89" rustversion = "1"