Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
pronebird committed Jan 17, 2025
1 parent 59cc78b commit f8e128e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ trait TunnelStateHandler: Send {
) -> NextTunnelState;
}

// todo: fix large enum; 248 byte enum is by no means a problem but clippy thinks we develop a firmware for Mars rovers.
#[allow(clippy::large_enum_variant)]
enum NextTunnelState {
NewState((Box<dyn TunnelStateHandler>, PrivateTunnelState)),
SameState(Box<dyn TunnelStateHandler>),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl TunnelStateHandler for ConnectingState {
}
TunnelMonitorEvent::Up(conn_data) => {
NextTunnelState::NewState(ConnectedState::enter(
conn_data,
*conn_data,
self.selected_gateways.expect("selected gateways must be set"),
self.monitor_handle,
self.monitor_event_receiver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub enum TunnelMonitorEvent {
EstablishingTunnel(Box<ConnectionData>),

/// Tunnel is up
Up(ConnectionData),
Up(Box<ConnectionData>),

/// Tunnel went down
Down(Option<ErrorStateReason>),
Expand Down Expand Up @@ -346,7 +346,7 @@ impl TunnelMonitor {
connected_at: Some(OffsetDateTime::now_utc()),
..conn_data
};
self.send_event(TunnelMonitorEvent::Up(conn_data));
self.send_event(TunnelMonitorEvent::Up(Box::new(conn_data)));

let task_error = self
.cancel_token
Expand Down

0 comments on commit f8e128e

Please sign in to comment.