diff --git a/postgres-protocol/src/authentication/sasl.rs b/postgres-protocol/src/authentication/sasl.rs index 994f0c4b..c99a27a2 100644 --- a/postgres-protocol/src/authentication/sasl.rs +++ b/postgres-protocol/src/authentication/sasl.rs @@ -2,8 +2,8 @@ use hmac::{Hmac, Mac, NewMac}; use rand::{self, Rng}; -use sha2::{Digest, Sha256}; use sha2::digest::FixedOutput; +use sha2::{Digest, Sha256}; use std::fmt::Write; use std::io; use std::iter; @@ -271,8 +271,8 @@ impl ScramSha256 { hmac.update(b"Server Key"); let server_key = hmac.finalize().into_bytes(); - let mut hmac = Hmac::::new_varkey(&server_key) - .expect("HMAC is able to accept all key sizes"); + let mut hmac = + Hmac::::new_varkey(&server_key).expect("HMAC is able to accept all key sizes"); hmac.update(auth_message.as_bytes()); hmac.verify(&verifier) .map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "SCRAM verification error")) diff --git a/postgres-types/src/lib.rs b/postgres-types/src/lib.rs index dbde5eb0..e78cedf4 100644 --- a/postgres-types/src/lib.rs +++ b/postgres-types/src/lib.rs @@ -158,16 +158,17 @@ macro_rules! accepts { #[macro_export] macro_rules! to_sql_checked { () => { - fn to_sql_checked(&self, - ty: &$crate::Type, - out: &mut $crate::private::BytesMut) - -> ::std::result::Result<$crate::IsNull, - Box> { + fn to_sql_checked( + &self, + ty: &$crate::Type, + out: &mut $crate::private::BytesMut, + ) -> ::std::result::Result< + $crate::IsNull, + Box, + > { $crate::__to_sql_checked(self, ty, out) } - } + }; } // WARNING: this function is not considered part of this crate's public API.