From c64504e92a0af3b721b722136652612705276efa Mon Sep 17 00:00:00 2001 From: "Michael P. Jung" Date: Tue, 19 Nov 2024 13:15:14 +0000 Subject: [PATCH] Update async-memcached to latest version and fix deadpool-memcached --- memcached/CHANGELOG.md | 4 +++- memcached/Cargo.toml | 5 ++++- memcached/src/lib.rs | 12 +++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/memcached/CHANGELOG.md b/memcached/CHANGELOG.md index 3420ae7..eeec833 100644 --- a/memcached/CHANGELOG.md +++ b/memcached/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Update `async-memcached` to version `0.4` + ## [0.3.2] - 2024-05-04 - Update `deadpool` dependency to version `0.12` @@ -44,4 +46,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [0.3.0]: https://github.com/bikeshedder/deadpool/compare/deadpool-memcached-v0.2.0...deadpool-memcached-v0.3.0 [0.2.0]: https://github.com/bikeshedder/deadpool/compare/deadpool-memcached-v0.1.2...deadpool-memcached-v0.2.0 [0.1.2]: https://github.com/bikeshedder/deadpool/compare/deadpool-memcached-v0.1.0...deadpool-memcached-v0.1.2 -[0.1.0]: https://github.com/bikeshedder/deadpool/deadpool-memcached-v0.1.0 \ No newline at end of file +[0.1.0]: https://github.com/bikeshedder/deadpool/deadpool-memcached-v0.1.0 diff --git a/memcached/Cargo.toml b/memcached/Cargo.toml index ff038a2..f5952f2 100644 --- a/memcached/Cargo.toml +++ b/memcached/Cargo.toml @@ -22,7 +22,7 @@ default = ["tcp"] tcp = ["async-memcached/tcp"] [dependencies] -async-memcached = { version = "0.1", default-features = false } +async-memcached = { version = "0.4", default-features = false } deadpool = { path = "../", version = "0.12.0", default-features = false, features = [ "managed", ] } @@ -32,5 +32,8 @@ deadpool = { path = "../", version = "0.12.0", default-features = false, feature # again. tokio = { version = "1.0", default-features = false, features = ["net"] } +[dev-dependencies] +tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } + [package.metadata.cargo-machete] ignored = ["tokio"] diff --git a/memcached/src/lib.rs b/memcached/src/lib.rs index 2a8d2b3..b150de4 100644 --- a/memcached/src/lib.rs +++ b/memcached/src/lib.rs @@ -17,7 +17,13 @@ type RecycleResult = deadpool::managed::RecycleResult; type ConfigError = Infallible; pub use deadpool::managed::reexports::*; -deadpool::managed_reexports!("memcached", Manager, Client, Error, ConfigError); +deadpool::managed_reexports!( + "memcached", + Manager, + deadpool::managed::Object, + Error, + ConfigError +); /// The manager for creating and recyling memcache connections pub struct Manager { @@ -26,8 +32,8 @@ pub struct Manager { impl Manager { /// Create a new manager for the given address. - pub fn new(addr: String) -> Self { - Self { addr } + pub fn new(addr: impl Into) -> Self { + Self { addr: addr.into() } } }