Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make EcoVec::extend_from_trusted public #39

Merged
merged 1 commit into from
Mar 23, 2024
Merged

Conversation

kaikalii
Copy link
Contributor

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
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

Additional details and impacted files
@@            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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@laurmaedje
Copy link
Member

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 kaikalii force-pushed the main branch 2 times, most recently from 08e32fa to 0b0a84d Compare March 16, 2024 20:43
Add the bound `I::IntoIter: ExactSizeIterator` to try to prevent unsafe usage. The `count` parameter is removed in favor of `ExactSizeIterator::len`.
@kaikalii
Copy link
Contributor Author

I think that makes more sense. Updated.

@laurmaedje laurmaedje merged commit b9147cc into typst:main Mar 23, 2024
4 checks passed
@laurmaedje
Copy link
Member

Thanks! Do you want a release?

@kaikalii
Copy link
Contributor Author

That would be great.

@laurmaedje
Copy link
Member

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants