Skip to content

Commit

Permalink
[Clippy] Fix complex types
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Dec 12, 2023
1 parent ada79d8 commit 8ffc2a1
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions test/test-rpc/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,18 @@ impl ConnectionHandle {
}
}

pub fn create_server_transports(
serial_stream: impl AsyncRead + AsyncWrite + Unpin + Send + 'static,
) -> (
type ServerTransports = (
tarpc::transport::channel::UnboundedChannel<
ClientMessage<ServiceRequest>,
Response<ServiceResponse>,
>,
GrpcForwarder,
CompletionHandle,
) {
);

pub fn create_server_transports(
serial_stream: impl AsyncRead + AsyncWrite + Unpin + Send + 'static,
) -> ServerTransports {
let (runner_forwarder_1, runner_forwarder_2) = tarpc::transport::channel::unbounded();

let (daemon_rx, mullvad_daemon_forwarder) = tokio::io::duplex(DAEMON_CHANNEL_BUF_SIZE);
Expand Down Expand Up @@ -164,18 +166,7 @@ pub fn create_server_transports(

pub fn create_client_transports(
serial_stream: impl AsyncRead + AsyncWrite + Unpin + Send + 'static,
) -> Result<
(
tarpc::transport::channel::UnboundedChannel<
Response<ServiceResponse>,
ClientMessage<ServiceRequest>,
>,
GrpcForwarder,
ConnectionHandle,
CompletionHandle,
),
Error,
> {
) -> Result<ClientTransports, Error> {
let (runner_forwarder_1, runner_forwarder_2) = tarpc::transport::channel::unbounded();

let (daemon_rx, mullvad_daemon_forwarder) = tokio::io::duplex(DAEMON_CHANNEL_BUF_SIZE);
Expand Down Expand Up @@ -216,6 +207,16 @@ pub fn create_client_transports(
))
}

type ClientTransports = (
tarpc::transport::channel::UnboundedChannel<
Response<ServiceResponse>,
ClientMessage<ServiceRequest>,
>,
GrpcForwarder,
ConnectionHandle,
CompletionHandle,
);

#[derive(err_derive::Error, Debug)]
#[error(no_from)]
enum ForwardError {
Expand Down

0 comments on commit 8ffc2a1

Please sign in to comment.