typst / ecow

Compact, clone-on-write vector and string.
Apache License 2.0
205 stars 16 forks source link

Make `EcoVec::extend_from_trusted` public #39

Closed kaikalii closed 6 months ago

kaikalii commented 6 months ago

Add the bound I::IntoIter: ExactSizeIterator to try to prevent unsafe usage.

I need this so I can do no-Clone extension without the overhead of the safe Extend::extend implementation referenced in #38.

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.09%. Comparing base (bb20e5d) to head (0b0a84d).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #39 +/- ## ========================================== + Coverage 88.04% 88.09% +0.04% ========================================== Files 3 3 Lines 1096 1100 +4 ========================================== + Hits 965 969 +4 Misses 131 131 ```

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

laurmaedje commented 6 months ago

Unfortunate that TrustedLen is unstable. I wonder whether we should keep count in the method signature though or whether we should rather use the len() method of ExactSizeIterator?

kaikalii commented 6 months ago

I think that makes more sense. Updated.

laurmaedje commented 6 months ago

Thanks! Do you want a release?

kaikalii commented 6 months ago

That would be great.

laurmaedje commented 6 months ago

Done.