From 7c2795d94eb9cf20588925d49fc4d7dde78b5bf2 Mon Sep 17 00:00:00 2001 From: Martijn <> Date: Fri, 10 Jun 2022 16:10:50 +0200 Subject: [PATCH] Fix experimental_handle_disconnect_ack 'feature' conditional compilation * Renamed from experimental-handle_disconnect_ack to experimental_handle_disconnect_ack * Fixed conditional compilation by removing space at the end of the cfg macro --- Cargo.toml | 2 +- src/listener.rs | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index db88e5c..37b15ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ msrv = "1.38" exclude = ["/.github", "docs/sketches/*.png"] [features] -experimental-handle_disconnect_ack = [] +experimental_handle_disconnect_ack = [] [dependencies] crossbeam-channel = "0.5" diff --git a/src/listener.rs b/src/listener.rs index deb6a7f..49ee87e 100644 --- a/src/listener.rs +++ b/src/listener.rs @@ -181,13 +181,12 @@ where Err(_disconnect) => { handler.finish(); - let ack = disconnect_sender.acknowledge_disconnection(); + let _ack = disconnect_sender.acknowledge_disconnection(); - #[cfg(feature = "experimental-handle_disconnect_ack ")] - ack.unwrap_or_default(); - - #[cfg(not(feature = "experimental-handle_disconnect_ack "))] - ack.expect("Failed to send disconnect acknowledgement!"); + #[cfg(not(feature = "experimental_handle_disconnect_ack"))] + { + _ack.expect("Failed to send disconnect acknowledgement!"); + } break; }