Use then instead of then_some when checking upnp_enabled to avoid useless UPnP query (#6170)

* Use `then` instead of `then_some` when checking `upnp_enabled` to avoid useless UPnP query
This commit is contained in:
dknopik
2024-07-25 05:39:02 +02:00
committed by GitHub
parent a3f44c674b
commit a2ab26c327

View File

@@ -385,7 +385,7 @@ impl<E: EthSpec> Network<E> {
let upnp = Toggle::from(
config
.upnp_enabled
.then_some(libp2p::upnp::tokio::Behaviour::default()),
.then(libp2p::upnp::tokio::Behaviour::default),
);
let behaviour = {
Behaviour {