diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a1f326a..1724bbc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,9 +22,6 @@ jobs: rust: - stable - 1.64.0 - indexmap: - - 1.9.3 - - 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/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] 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" 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),