-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add quic/tcp features and set quic as default #22
Conversation
src/local.rs
Outdated
"/ip4/127.0.0.1/tcp/{port}/p2p/{peer_id}" | ||
))?) | ||
} else | ||
// efault to quic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo. Maybe also use #[cfg(feature = "quic")]
like below to keep it consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should also force this library to be compiled with either quic
or tcp
, because it's not possible to compile without either feature.
src/service.rs
Outdated
} else if cfg!(feature = "quic") { | ||
UdpSocket::bind(("127.0.0.1", port)).is_ok() | ||
} else { | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling this crate without either tcp
and quic
feature doesn't really make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aye, the compiler complained that it could still. I'm not sure of the best default strat here 🤔
src/local.rs
Outdated
"/ip4/127.0.0.1/tcp/{port}/p2p/{peer_id}" | ||
))?) | ||
if cfg!(feature = "tcp") { | ||
#[cfg(feature = "tcp")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double feature gate here?
No description provided.