thomcc / arcstr

Better reference counted strings for Rust
Apache License 2.0
114 stars 18 forks source link

Added `ArcStr::repeat` and `ArcStr::try_repeat` #50

Closed Kixiron closed 1 year ago

Kixiron commented 1 year ago

Adds the ArcStr::repeat and ArcStr::try_repeat functions which are morally equivalent to String::repeat, allows users to avoid an intermediate String allocation in some circumstances

codecov-commenter commented 1 year ago

Codecov Report

Base: 92.24% // Head: 92.48% // Increases project coverage by +0.24% :tada:

Coverage data is based on head (9b37f19) compared to base (72d9d0b). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #50 +/- ## ========================================== + Coverage 92.24% 92.48% +0.24% ========================================== Files 4 4 Lines 374 386 +12 ========================================== + Hits 345 357 +12 Misses 29 29 ``` | [Impacted Files](https://codecov.io/gh/thomcc/arcstr/pull/50?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Thom+Chiovoloni) | Coverage Δ | | |---|---|---| | [src/arc\_str.rs](https://codecov.io/gh/thomcc/arcstr/pull/50/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Thom+Chiovoloni#diff-c3JjL2FyY19zdHIucnM=) | `92.10% <100.00%> (+0.43%)` | :arrow_up: | | [src/substr.rs](https://codecov.io/gh/thomcc/arcstr/pull/50/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Thom+Chiovoloni#diff-c3JjL3N1YnN0ci5ycw==) | `94.32% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Thom+Chiovoloni). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Thom+Chiovoloni)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

thomcc commented 1 year ago

You need to put the test in the integration test folder. Under #[cfg(loom)] all the atomics and such become weird loom shit, which is broken to use outside loom::model. You could also put your tests behind #[cfg(not(loom))], but just put them with the others.

thomcc commented 1 year ago

in 1.1.5