Skip to content

Commit

Permalink
Merge pull request #250 from alexrudy/chore/client/pool-tests
Browse files Browse the repository at this point in the history
tests: improve var names in token tests
  • Loading branch information
alexrudy authored Dec 29, 2024
2 parents 93cbb91 + be0803a commit fadb047
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/client/conn/protocol/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ where
HttpProtocol::Http2 => self.handshake_h2(transport).await,
HttpProtocol::Http1 => {
#[cfg(feature = "tls")]
if transport
.tls_info()
.as_ref()
.and_then(|tls| tls.alpn.as_ref())
if transport.tls_info().and_then(|tls| tls.alpn.as_ref())
== Some(&crate::info::Protocol::Http(http::Version::HTTP_2))
{
trace!("alpn h2 switching");
Expand Down
12 changes: 6 additions & 6 deletions src/client/pool/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ pub(crate) mod test_key {
counter: NonZeroUsize::new(usize::MAX).unwrap(),
..Default::default()
};
let token = map.insert("key");
assert_eq!(token.0, Some(NonZeroUsize::new(usize::MAX).unwrap()));
let foo = map.insert("key");
assert_eq!(foo.0, Some(NonZeroUsize::new(usize::MAX).unwrap()));

let token = map.insert("bar");
assert_eq!(token.0, Some(NonZeroUsize::new(1).unwrap()));
let bar = map.insert("bar");
assert_eq!(bar.0, Some(NonZeroUsize::new(1).unwrap()));

assert_eq!(map.insert("bar"), token);
assert_ne!(map.insert("key"), token);
assert_eq!(map.insert("bar"), bar);
assert_ne!(map.insert("key"), bar);
}
}

0 comments on commit fadb047

Please sign in to comment.