Skip to content

Commit 7b23059

Browse files
committed
Some cleanup
1 parent 6c3a4ab commit 7b23059

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tokio-postgres/src/connect_raw.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ where
142142
{
143143
match stream.try_next().await.map_err(Error::io)? {
144144
Some(Message::AuthenticationOk) => {
145-
no_channel_binding(config)?;
145+
can_skip_channel_binding(config)?;
146146
return Ok(());
147147
}
148148
Some(Message::AuthenticationCleartextPassword) => {
149-
no_channel_binding(config)?;
149+
can_skip_channel_binding(config)?;
150150

151151
let pass = config
152152
.password
@@ -156,7 +156,7 @@ where
156156
authenticate_password(stream, pass).await?;
157157
}
158158
Some(Message::AuthenticationMd5Password(body)) => {
159-
no_channel_binding(config)?;
159+
can_skip_channel_binding(config)?;
160160

161161
let user = config
162162
.user
@@ -194,7 +194,7 @@ where
194194
}
195195
}
196196

197-
fn no_channel_binding(config: &Config) -> Result<(), Error> {
197+
fn can_skip_channel_binding(config: &Config) -> Result<(), Error> {
198198
match config.channel_binding {
199199
config::ChannelBinding::Disable | config::ChannelBinding::Prefer => Ok(()),
200200
config::ChannelBinding::Require => Err(Error::authentication(
@@ -258,7 +258,7 @@ where
258258
None => (sasl::ChannelBinding::unsupported(), sasl::SCRAM_SHA_256),
259259
}
260260
} else if has_scram {
261-
no_channel_binding(config)?;
261+
can_skip_channel_binding(config)?;
262262

263263
match channel_binding {
264264
Some(_) => (sasl::ChannelBinding::unrequested(), sasl::SCRAM_SHA_256),

0 commit comments

Comments
 (0)