rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Return slices, rather than `Vec` references, in addresses

Open TheBlueMatt opened this issue 1 year ago • 1 comments

Its a bit strange to return a reference to a Vec in Rust, when a slice is really intended as the way to do so. Worse, the bindings don't know how to map a reference to a Vec (but do have code to map a slice of Cloneable objects).

Here, we move NodeAnnouncementInfo::addresses to return a slice, though to do so we have to adapt the WithoutLength Writeable impl to support slices as well.

TheBlueMatt avatar Aug 14 '24 19:08 TheBlueMatt

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.73%. Comparing base (33e6995) to head (b3aed9a). Report is 2 commits behind head on main.

Files Patch % Lines
lightning-rapid-gossip-sync/src/processing.rs 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3241      +/-   ##
==========================================
- Coverage   89.78%   89.73%   -0.06%     
==========================================
  Files         123      123              
  Lines      102330   102332       +2     
  Branches   102330   102332       +2     
==========================================
- Hits        91876    91825      -51     
- Misses       7763     7816      +53     
  Partials     2691     2691              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 14 '24 20:08 codecov[bot]