Skip to content

Commit cb18ea0

Browse files
committed
refine code
1 parent 1b9e8e0 commit cb18ea0

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Push or PR
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- '**'

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl From<Error> for std::io::Error {
6363
fn from(e: Error) -> Self {
6464
match e {
6565
Error::Io(e) => e,
66-
_ => std::io::Error::new(std::io::ErrorKind::Other, e),
66+
_ => std::io::Error::other(e),
6767
}
6868
}
6969
}

src/protocol/handshake/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Request {
2626
}
2727

2828
pub fn evaluate_method(&self, server_method: AuthMethod) -> bool {
29-
self.methods.iter().any(|&m| m == server_method)
29+
self.methods.contains(&server_method)
3030
}
3131
}
3232

src/server/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl AuthExecutor for UserKeyAuth {
8686
if is_equal {
8787
Ok(true)
8888
} else {
89-
Err(std::io::Error::new(std::io::ErrorKind::Other, "username or password is incorrect"))
89+
Err(std::io::Error::other("username or password is incorrect"))
9090
}
9191
}
9292
}

0 commit comments

Comments
 (0)