From b9112975864bd4eb26b40c8cdc371ac8c053fb0f Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Tue, 10 Sep 2019 23:44:38 -0700 Subject: [PATCH] Export MariaDb from root --- Cargo.toml | 1 - src/lib.rs | 5 +++++ src/postgres/protocol/password_message.rs | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b78c6514..b744f1fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ crossbeam-utils = { version = "0.6.6", default-features = false } futures-channel-preview = "0.3.0-alpha.18" futures-core-preview = "0.3.0-alpha.18" futures-util-preview = "0.3.0-alpha.18" -hex = { version = "0.3.2", default-features = false } log = "0.4.8" md-5 = "0.8.0" memchr = "2.2.1" diff --git a/src/lib.rs b/src/lib.rs index 2a959f5a..809185c3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,8 +43,13 @@ pub use self::{ #[cfg(feature = "mariadb")] pub mod mariadb; +#[cfg(feature = "mariadb")] +#[doc(inline)] +pub use mariadb::MariaDb; + #[cfg(feature = "postgres")] pub mod postgres; #[cfg(feature = "postgres")] +#[doc(inline)] pub use self::postgres::Postgres; diff --git a/src/postgres/protocol/password_message.rs b/src/postgres/protocol/password_message.rs index 254dfc1d..8ace172b 100644 --- a/src/postgres/protocol/password_message.rs +++ b/src/postgres/protocol/password_message.rs @@ -34,12 +34,12 @@ impl Encode for PasswordMessage<'_> { hasher.input(password); hasher.input(user); - let credentials = hex::encode(hasher.result_reset()); + let credentials = format!("{:x}", hasher.result_reset()); hasher.input(credentials); hasher.input(salt); - let salted = hex::encode(hasher.result()); + let salted = format!("{:x}", hasher.result()); // len + "md5" + (salted) buf.put_u32::((4 + 3 + salted.len() + 1) as u32);