Skip to content

Commit b4096c6

Browse files
committed
Fix client connector usage, fixes lifetime constraint
1 parent 7451e02 commit b4096c6

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## [0.5.1] - 2023-06-23
4+
5+
* Fix client connector usage, fixes lifetime constraint
6+
37
## [0.5.0] - 2023-06-22
48

59
* Migrate to ntex 0.7

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-redis"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
authors = ["ntex contributors <[email protected]>"]
55
description = "Redis client"
66
documentation = "https://docs.rs/ntex-redis"
@@ -12,7 +12,7 @@ exclude = [".gitignore", ".travis.yml", ".cargo/config"]
1212
edition = "2018"
1313

1414
[dependencies]
15-
ntex = "0.7.0"
15+
ntex = "0.7.2"
1616
itoa = "1.0.0"
1717
btoi = "0.4.2"
1818
log = "0.4"
@@ -21,4 +21,4 @@ derive_more = "0.99"
2121
[dev-dependencies]
2222
rand = "0.8"
2323
env_logger = "0.10"
24-
ntex = { version = "0.7.0", features = ["tokio"] }
24+
ntex = { version = "0.7.2", features = ["tokio"] }

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{cell::RefCell, fmt, future::Future, pin::Pin, rc::Rc, task::Context, t
33

44
use ntex::io::{IoBoxed, IoRef, OnDisconnect, RecvError};
55
use ntex::util::{poll_fn, ready, Either, Ready};
6-
use ntex::{channel::pool, service::ServiceCtx, service::Service};
6+
use ntex::{channel::pool, service::Service, service::ServiceCtx};
77

88
use super::cmd::Command;
99
use super::codec::{Codec, Request, Response};

src/connector.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ where
7373
IoBoxed: From<T::Response>,
7474
{
7575
async fn _connect(&self) -> Result<IoBoxed, ConnectError> {
76-
let fut = self.connector.call(Connect::new(self.address.clone()));
77-
let io = IoBoxed::from(fut.await?);
76+
let io: IoBoxed = self
77+
.connector
78+
.service_call(Connect::new(self.address.clone()))
79+
.await?
80+
.into();
7881
io.set_memory_pool(self.pool);
7982
io.set_disconnect_timeout(Seconds::ZERO.into());
8083

0 commit comments

Comments
 (0)