Skip to content

Commit

Permalink
Fix double indirect call in default CID generator factory
Browse files Browse the repository at this point in the history
A lambda expression is a unique ZST, but coercing it to a function
pointer discards that information.
  • Loading branch information
Ralith authored and djc committed May 23, 2024
1 parent 70f5f6d commit 9229c37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quinn-proto/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ pub struct EndpointConfig {
impl EndpointConfig {
/// Create a default config with a particular `reset_key`
pub fn new(reset_key: Arc<dyn HmacKey>) -> Self {
let cid_factory: fn() -> Box<dyn ConnectionIdGenerator> =
|| Box::<HashedConnectionIdGenerator>::default();
let cid_factory =
|| -> Box<dyn ConnectionIdGenerator> { Box::<HashedConnectionIdGenerator>::default() };
Self {
reset_key,
max_udp_payload_size: (1500u32 - 28).into(), // Ethernet MTU minus IP + UDP headers
Expand Down

0 comments on commit 9229c37

Please sign in to comment.