Skip to content

Commit

Permalink
chore: Use specific io error constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Jan 11, 2025
1 parent cbca447 commit 54a41bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
5 changes: 1 addition & 4 deletions examples/src/mock/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
if let Some(client) = client {
Ok(TokioIo::new(client))
} else {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Client already taken",
))
Err(std::io::Error::other("Client already taken"))
}
}
}))
Expand Down
10 changes: 2 additions & 8 deletions tests/integration_tests/tests/max_message_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,7 @@ async fn response_stream_limit() {
if let Some(client) = client {
Ok(TokioIo::new(client))
} else {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Client already taken",
))
Err(std::io::Error::other("Client already taken"))
}
}
}))
Expand Down Expand Up @@ -335,10 +332,7 @@ async fn max_message_run(case: &TestCase) -> Result<(), Status> {
if let Some(client) = client {
Ok(TokioIo::new(client))
} else {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Client already taken",
))
Err(std::io::Error::other("Client already taken"))
}
}
}))
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/tests/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async fn status_from_server_stream_with_source() {
let channel = Endpoint::try_from("http://[::]:50051")
.unwrap()
.connect_with_connector_lazy(tower::service_fn(move |_: Uri| async move {
Err::<TokioIo<MockStream>, _>(std::io::Error::new(std::io::ErrorKind::Other, "WTF"))
Err::<TokioIo<MockStream>, _>(std::io::Error::other("WTF"))
}));

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

0 comments on commit 54a41bf

Please sign in to comment.