Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions async-nats/src/jetstream/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub mod traits {
}

pub trait ClientProvider {
fn client(&self) -> crate::Client;
fn client(&self) -> &crate::Client;
}

pub trait TimeoutProvider {
Expand Down Expand Up @@ -342,8 +342,8 @@ impl Context {
}

/// Return a clone of the underlying NATS client.
pub fn client(&self) -> Client {
self.client.clone()
pub fn client(&self) -> &Client {
&self.client
}

/// Waits until all pending `acks` are received from the server.
Expand Down Expand Up @@ -1731,7 +1731,7 @@ impl crate::client::traits::Publisher for Context {
}

impl traits::ClientProvider for Context {
fn client(&self) -> crate::Client {
fn client(&self) -> &crate::Client {
self.client()
}
}
Expand Down
Loading