Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
neelayjunnarkar committed Nov 4, 2024
1 parent 72b66fd commit b3c5df1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 5 additions & 1 deletion insanity-native-tui-app/src/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ impl ConnectionManagerBuilder {
IpVersion::Dualstack => {
let v4_addr = SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, self.listen_port);
// TODO: maybe have a better way for specifying both ipv4 and ipv6 listen ports simultaneously.
let ipv6_listen_port = if self.listen_port == 0 { 0 } else { self.listen_port + 1 };
let ipv6_listen_port = if self.listen_port == 0 {
0
} else {
self.listen_port + 1
};
let v6_addr = SocketAddrV6::new(Ipv6Addr::UNSPECIFIED, ipv6_listen_port, 0, 0);
VeqSocket::dualstack_with_keypair(v4_addr, v6_addr, keypair).await?
}
Expand Down
15 changes: 8 additions & 7 deletions insanity-native-tui-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use std::{path::PathBuf, str::FromStr, time::Duration};

use clap::{Parser, Subcommand};
use insanity_core::built_info;
use insanity_native_tui_app::{connection_manager::ConnectionManager, update, connection_manager::IpVersion};
use insanity_native_tui_app::{
connection_manager::ConnectionManager, connection_manager::IpVersion, update,
};
use insanity_tui_adapter::AppEvent;
use tokio_util::sync::CancellationToken;

Expand All @@ -29,8 +31,6 @@ enum Commands {
},
}



#[derive(Parser, Debug)]
struct RunOptions {
#[clap(short, long, default_value = "0")]
Expand All @@ -54,7 +54,7 @@ struct RunOptions {

/// IPV4, IPV6, or dualstack
#[clap(long, value_enum, default_value_t = IpVersion::Ipv4)]
ip_version: IpVersion
ip_version: IpVersion,
}

#[tokio::main]
Expand Down Expand Up @@ -116,9 +116,10 @@ async fn run(opts: RunOptions) -> anyhow::Result<()> {
};

// Start connection manager
let mut conn_manager_builder = ConnectionManager::builder(insanity_dir, opts.port, opts.bridge, opts.ip_version)
.display_name(display_name)
.cancellation_token(main_cancellation_token.clone());
let mut conn_manager_builder =
ConnectionManager::builder(insanity_dir, opts.port, opts.bridge, opts.ip_version)
.display_name(display_name)
.cancellation_token(main_cancellation_token.clone());
if let Some(room) = opts.room {
conn_manager_builder = conn_manager_builder.room(room);
}
Expand Down

0 comments on commit b3c5df1

Please sign in to comment.