Remove a bunch of (hopefully) unnecessary Pins.

I believe these were introduced previously to solve a problem that we're
no longer dealing with; specifically, if I remember correctly, we
introduced these to deal with how we were going to implement a trait.
However, they don't appear to be necessary any more, so we're going to
get rid of them, so we won't need to deal with them any longer.
This commit is contained in:
2021-10-09 15:22:10 -07:00
parent a2c57e4c76
commit 0d35f1cdb3
12 changed files with 48 additions and 63 deletions

View File

@@ -8,7 +8,6 @@ use futures::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
#[cfg(test)]
use quickcheck::{quickcheck, Arbitrary, Gen};
use std::fmt;
use std::pin::Pin;
#[allow(clippy::upper_case_acronyms)]
#[derive(Clone, Debug, Eq, PartialEq)]
@@ -48,7 +47,7 @@ impl fmt::Display for AuthenticationMethod {
impl AuthenticationMethod {
pub async fn read<R: AsyncRead + Send + Unpin>(
mut r: Pin<&mut R>,
r: &mut R,
) -> Result<AuthenticationMethod, DeserializationError> {
let mut byte_buffer = [0u8; 1];
let amount_read = r.read(&mut byte_buffer).await?;
@@ -123,7 +122,7 @@ standard_roundtrip!(auth_byte_roundtrips, AuthenticationMethod);
fn bad_byte() {
let no_len = vec![42];
let mut cursor = Cursor::new(no_len);
let ys = AuthenticationMethod::read(Pin::new(&mut cursor));
let ys = AuthenticationMethod::read(&mut cursor);
assert_eq!(
Err(DeserializationError::AuthenticationMethodError(
AuthenticationDeserializationError::InvalidAuthenticationByte(42)