servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.31k stars 325 forks source link

perf(punycode): avoid double allocation in decode_to_string #894

Closed bishopcheckmate closed 8 months ago

bishopcheckmate commented 8 months ago

Hey, while indeed decode_to_string is a nice ergonomics addition, the fact of being a wrapper over the decode results in an intermediate Vec. Since the implementation of it can be the same as decode and it's quite straightforward, maybe we could get rid of double alloc cheaply

codecov[bot] commented 8 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (92f356e) 81.70% compared to head (d318128) 81.70%.

:exclamation: Current head d318128 differs from pull request most recent head a5ff8fa. Consider uploading reports for the commit a5ff8fa to get more accurate results

Files Patch % Lines
idna/src/punycode.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #894 +/- ## ======================================= Coverage 81.70% 81.70% ======================================= Files 20 20 Lines 3547 3547 ======================================= Hits 2898 2898 Misses 649 649 ```

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