Skip to content

Commit caebc2d

Browse files
authored
Merge pull request #33 from bk-rs/remove-unreachable
Remove unreachable
2 parents 81ea09c + f526c9c commit caebc2d

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

async-ssh2-lite/src/session_stream/impl_async_io.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ where
3636
}
3737

3838
match sess.block_directions() {
39-
BlockDirections::None => {
40-
unreachable!("")
41-
}
39+
BlockDirections::None => continue,
4240
BlockDirections::Inbound => {
4341
assert!(expected_block_directions.is_readable());
4442

@@ -80,9 +78,7 @@ where
8078
}
8179

8280
match sess.block_directions() {
83-
BlockDirections::None => {
84-
unreachable!("")
85-
}
81+
BlockDirections::None => return Poll::Pending,
8682
BlockDirections::Inbound => {
8783
assert!(expected_block_directions.is_readable());
8884

async-ssh2-lite/src/session_stream/impl_tokio.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ impl AsyncSessionStream for TcpStream {
3535
}
3636

3737
match sess.block_directions() {
38-
BlockDirections::None => {
39-
unreachable!("")
40-
}
38+
BlockDirections::None => continue,
4139
BlockDirections::Inbound => {
4240
assert!(expected_block_directions.is_readable());
4341

@@ -77,9 +75,7 @@ impl AsyncSessionStream for TcpStream {
7775
}
7876

7977
match sess.block_directions() {
80-
BlockDirections::None => {
81-
unreachable!("")
82-
}
78+
BlockDirections::None => return Poll::Pending,
8379
BlockDirections::Inbound => {
8480
assert!(expected_block_directions.is_readable());
8581

@@ -135,9 +131,7 @@ impl AsyncSessionStream for UnixStream {
135131
}
136132

137133
match sess.block_directions() {
138-
BlockDirections::None => {
139-
unreachable!("")
140-
}
134+
BlockDirections::None => continue,
141135
BlockDirections::Inbound => {
142136
assert!(expected_block_directions.is_readable());
143137

@@ -177,9 +171,7 @@ impl AsyncSessionStream for UnixStream {
177171
}
178172

179173
match sess.block_directions() {
180-
BlockDirections::None => {
181-
unreachable!("")
182-
}
174+
BlockDirections::None => return Poll::Pending,
183175
BlockDirections::Inbound => {
184176
assert!(expected_block_directions.is_readable());
185177

0 commit comments

Comments
 (0)