Skip to content

Commit 54a41bf

Browse files
committed
chore: Use specific io error constructor
1 parent cbca447 commit 54a41bf

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

examples/src/mock/mock.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
3939
if let Some(client) = client {
4040
Ok(TokioIo::new(client))
4141
} else {
42-
Err(std::io::Error::new(
43-
std::io::ErrorKind::Other,
44-
"Client already taken",
45-
))
42+
Err(std::io::Error::other("Client already taken"))
4643
}
4744
}
4845
}))

tests/integration_tests/tests/max_message_size.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ async fn response_stream_limit() {
166166
if let Some(client) = client {
167167
Ok(TokioIo::new(client))
168168
} else {
169-
Err(std::io::Error::new(
170-
std::io::ErrorKind::Other,
171-
"Client already taken",
172-
))
169+
Err(std::io::Error::other("Client already taken"))
173170
}
174171
}
175172
}))
@@ -335,10 +332,7 @@ async fn max_message_run(case: &TestCase) -> Result<(), Status> {
335332
if let Some(client) = client {
336333
Ok(TokioIo::new(client))
337334
} else {
338-
Err(std::io::Error::new(
339-
std::io::ErrorKind::Other,
340-
"Client already taken",
341-
))
335+
Err(std::io::Error::other("Client already taken"))
342336
}
343337
}
344338
}))

tests/integration_tests/tests/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ async fn status_from_server_stream_with_source() {
198198
let channel = Endpoint::try_from("http://[::]:50051")
199199
.unwrap()
200200
.connect_with_connector_lazy(tower::service_fn(move |_: Uri| async move {
201-
Err::<TokioIo<MockStream>, _>(std::io::Error::new(std::io::ErrorKind::Other, "WTF"))
201+
Err::<TokioIo<MockStream>, _>(std::io::Error::other("WTF"))
202202
}));
203203

204204
let mut client = test_stream_client::TestStreamClient::new(channel);

0 commit comments

Comments
 (0)