Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20f6bc5

Browse files
Fix latest clippy warnings
1 parent490c485 commit20f6bc5

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

‎postgres-protocol/src/authentication/sasl.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl ScramSha256 {
180180
password,
181181
channel_binding,
182182
} =>(nonce, password, channel_binding),
183-
_ =>returnErr(io::Error::new(io::ErrorKind::Other,"invalid SCRAM state")),
183+
_ =>returnErr(io::Error::other("invalid SCRAM state")),
184184
};
185185

186186
let message =
@@ -252,7 +252,7 @@ impl ScramSha256 {
252252
salted_password,
253253
auth_message,
254254
} =>(salted_password, auth_message),
255-
_ =>returnErr(io::Error::new(io::ErrorKind::Other,"invalid SCRAM state")),
255+
_ =>returnErr(io::Error::other("invalid SCRAM state")),
256256
};
257257

258258
let message =
@@ -262,10 +262,7 @@ impl ScramSha256 {
262262

263263
let verifier =match parsed{
264264
ServerFinalMessage::Error(e) =>{
265-
returnErr(io::Error::new(
266-
io::ErrorKind::Other,
267-
format!("SCRAM error: {}", e),
268-
));
265+
returnErr(io::Error::other(format!("SCRAM error: {}", e)));
269266
}
270267
ServerFinalMessage::Verifier(verifier) => verifier,
271268
};

‎postgres-protocol/src/types/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ pub fn varbit_from_sql(mut buf: &[u8]) -> Result<Varbit<'_>, StdBox<dyn Error +
324324
if len <0{
325325
returnErr("invalid varbit length: varbit < 0".into());
326326
}
327-
let bytes =(lenasusize +7) /8;
327+
let bytes =(lenasusize).div_ceil(8);
328328
if buf.len() != bytes{
329329
returnErr("invalid message length: varbit mismatch".into());
330330
}

‎postgres/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Connection configuration.
22
3+
#![allow(clippy::doc_overindented_list_items)]
4+
35
usecrate::connection::Connection;
46
usecrate::Client;
57
use log::info;

‎postgres/src/copy_in_writer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ impl Write for CopyInWriter<'_> {
5353
}
5454

5555
fnflush(&mutself) -> io::Result<()>{
56-
self.flush_inner()
57-
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
56+
self.flush_inner().map_err(io::Error::other)
5857
}
5958
}

‎postgres/src/copy_out_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl BufRead for CopyOutReader<'_> {
4141
.block_on(async{ stream.next().await.transpose()})
4242
{
4343
Ok(Some(cur)) =>self.cur = cur,
44-
Err(e) =>returnErr(io::Error::new(io::ErrorKind::Other,e)),
44+
Err(e) =>returnErr(io::Error::other(e)),
4545
Ok(None) =>break,
4646
};
4747
}

‎tokio-postgres/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Connection configuration.
22
3+
#![allow(clippy::doc_overindented_list_items)]
4+
35
#[cfg(feature ="runtime")]
46
usecrate::connect::connect;
57
usecrate::connect_raw::connect_raw;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp