server: fix clippy nit in linux-only code

pull/239/head
Jake McGinty 2022-09-23 23:05:23 -05:00
parent 1aa16c84f5
commit f36eb301ce
2 changed files with 2 additions and 2 deletions

View File

@ -641,7 +641,7 @@ async fn serve(
/// See https://github.com/tonarino/innernet/issues/26 for more details.
#[cfg(target_os = "linux")]
fn get_listener(addr: SocketAddr, interface: &InterfaceName) -> Result<TcpListener, Error> {
let listener = TcpListener::bind(&addr)?;
let listener = TcpListener::bind(addr)?;
listener.set_nonblocking(true)?;
let sock = socket2::Socket::from(listener);
sock.bind_device(Some(interface.as_str_lossy().as_bytes()))?;

View File

@ -104,7 +104,7 @@ impl Server {
let interface = interface.parse().unwrap();
// Add developer CIDR and user CIDR and some peers for testing.
let db = Connection::open(&conf.database_path(&interface))?;
db.pragma_update(None, "foreign_keys", &1)?;
db.pragma_update(None, "foreign_keys", 1)?;
assert_eq!(ADMIN_CIDR_ID, create_cidr(&db, "admin", ADMIN_CIDR)?.id);
assert_eq!(
ADMIN_PEER_ID,