make it no mut
This commit is contained in:
@@ -196,7 +196,7 @@ where
|
||||
type Response = Pin<Box<dyn Stream<Item = Result<DnsResponse, E>> + Send>>;
|
||||
type Error = E;
|
||||
|
||||
fn send<R: Into<DnsRequest>>(&mut self, _: R) -> Self::Response {
|
||||
fn send<R: Into<DnsRequest>>(&self, _: R) -> Self::Response {
|
||||
let mut messages = self.messages.lock().expect("failed to lock at messages");
|
||||
println!("MockClientHandle::send message count: {}", messages.len());
|
||||
|
||||
@@ -247,7 +247,7 @@ pub fn error<E>(error: E) -> Result<DnsResponse, E> {
|
||||
|
||||
pub trait OnSend: Clone + Send + Sync + 'static {
|
||||
fn on_send<E>(
|
||||
&mut self,
|
||||
&self,
|
||||
response: Result<DnsResponse, E>,
|
||||
) -> Pin<Box<dyn Future<Output = Result<DnsResponse, E>> + Send>>
|
||||
where
|
||||
|
@@ -645,7 +645,7 @@ impl OnSendBarrier {
|
||||
|
||||
impl OnSend for OnSendBarrier {
|
||||
fn on_send<E>(
|
||||
&mut self,
|
||||
&self,
|
||||
response: Result<DnsResponse, E>,
|
||||
) -> Pin<Box<dyn Future<Output = Result<DnsResponse, E>> + Send>>
|
||||
where
|
||||
|
@@ -23,7 +23,7 @@ impl DnsHandle for TestClient {
|
||||
type Response = Box<dyn Stream<Item = Result<DnsResponse, Self::Error>> + Send + Unpin>;
|
||||
type Error = ResolveError;
|
||||
|
||||
fn send<R: Into<DnsRequest>>(&mut self, _: R) -> Self::Response {
|
||||
fn send<R: Into<DnsRequest>>(&self, _: R) -> Self::Response {
|
||||
let i = self.attempts.load(Ordering::SeqCst);
|
||||
|
||||
if i > self.retries || self.retries - i == 0 {
|
||||
|
Reference in New Issue
Block a user