smoltcp-rs / smoltcp

a smol tcp/ip stack
BSD Zero Clause License
3.64k stars 404 forks source link

Add comment about using static lifetime for SocketSets with owned storage #813

Closed paulmenage closed 12 months ago

paulmenage commented 12 months ago

It wasn't obvious to me that 'static can/should be the lifetime to use with a SocketSet if you're not borrowing storage; adding a comment will hopefully save others a little time fighting with lifetime-creep and interactions with thread constraints (thread closures can only borrow 'static data).

codecov[bot] commented 12 months ago

Codecov Report

Merging #813 (6e47c7b) into main (7ff1364) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #813   +/-   ##
=======================================
  Coverage   79.65%   79.65%           
=======================================
  Files          72       72           
  Lines       27862    27862           
=======================================
  Hits        22193    22193           
  Misses       5669     5669           
Impacted Files Coverage Δ
src/iface/socket_set.rs 55.88% <ø> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more