Skip to content

Commit

Permalink
tests: fix implied_bounds_in_impls clippy warn
Browse files Browse the repository at this point in the history
```
error: this bound is already specified as the supertrait of `DerefMut`
   --> rustls/tests/./common/mod.rs:596:35
    |
596 |     client: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implied_bounds_in_impls
help: try removing this bound
    |
596 -     client: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
596 +     client: &mut (impl DerefMut<Target = ConnectionCommon<impl SideData>>),
```
  • Loading branch information
cpu authored and ctz committed Mar 25, 2024
1 parent 65dfd9c commit 77ffe49
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rustls/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![cfg(any(feature = "ring", feature = "aws_lc_rs"))]

use std::io;
use std::ops::{Deref, DerefMut};
use std::ops::DerefMut;
use std::sync::Arc;

use pki_types::{
Expand Down Expand Up @@ -153,8 +153,8 @@ embed_files! {
}

pub fn transfer(
left: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
right: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
left: &mut impl DerefMut<Target = ConnectionCommon<impl SideData>>,
right: &mut impl DerefMut<Target = ConnectionCommon<impl SideData>>,
) -> usize {
let mut buf = [0u8; 262144];
let mut total = 0;
Expand Down Expand Up @@ -182,7 +182,7 @@ pub fn transfer(
total
}

pub fn transfer_eof(conn: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>)) {
pub fn transfer_eof(conn: &mut impl DerefMut<Target = ConnectionCommon<impl SideData>>) {
let empty_buf = [0u8; 0];
let empty_cursor: &mut dyn io::Read = &mut &empty_buf[..];
let sz = conn.read_tls(empty_cursor).unwrap();
Expand Down Expand Up @@ -621,8 +621,8 @@ pub fn make_pair_for_arc_configs(
}

pub fn do_handshake(
client: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
server: &mut (impl DerefMut + Deref<Target = ConnectionCommon<impl SideData>>),
client: &mut impl DerefMut<Target = ConnectionCommon<impl SideData>>,
server: &mut impl DerefMut<Target = ConnectionCommon<impl SideData>>,
) -> (usize, usize) {
let (mut to_client, mut to_server) = (0, 0);
while server.is_handshaking() || client.is_handshaking() {
Expand Down

0 comments on commit 77ffe49

Please sign in to comment.