Skip to content

Commit

Permalink
Fix experimental_handle_disconnect_ack 'feature' conditional compilation
Browse files Browse the repository at this point in the history
* Renamed from experimental-handle_disconnect_ack to experimental_handle_disconnect_ack
* Fixed conditional compilation by removing space at the end of the cfg macro
  • Loading branch information
Martijn committed Jun 10, 2022
1 parent c08f5dc commit 7c2795d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 5 additions & 6 deletions src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7c2795d

Please sign in to comment.