mullvad / udp-over-tcp

Proxy UDP traffic over a TCP stream
Apache License 2.0
377 stars 61 forks source link

Use <[T]>::split_at_checked instead of two separate get calls #64

Closed faern closed 3 months ago

faern commented 3 months ago

Simplifies the code primarily. Probably allows for sliiightly more optimized code when compiling without optimizations also (?) For opt-level=3 the result is the same as before.

This split method was stabilized in Rust 1.80, released yesterday. But we don't need to support any old compilers. We are also not aiming for a release of this program/library right away. This is just a cleanup I have been wanting to do for a long time :D


This change is Reviewable