• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

unicode-org / icu4x / 8331678711
73%

Build:
DEFAULT BRANCH: main
Ran 18 Mar 2024 06:37PM UTC
Jobs 1
Files 900
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Mar 2024 06:18PM UTC coverage: 76.069% (+0.004%) from 76.065%
8331678711

push

github

web-flow
Add a lossy constructor for tinystr (#4691)

An instance where it is easier for me to write the patch and open a PR
than to start a discussion issue.

I want to be able to write,

```rust
const COMMON_SCRIPT: TinyStr<4> = TinyStr::some_constructor(b"Zyyy");
```

but as far as I can tell, the only way to do this currently would
require the unsafe `from_bytes_unchecked` constructor. I would like to
be able to avoid unsafe, as it introduces additional code review
obligations.


I feel like one possible solution to this would be a lossy constructor,
that handles invalid input by substituting invalid bytes with a valid
replacement.


This PR includes one possible version of this. I'm not at all married to
this particular implementation; it is offered as an illustration.

23 of 23 new or added lines in 1 file covered. (100.0%)

4 existing lines in 4 files now uncovered.

49931 of 65639 relevant lines covered (76.07%)

527080.44 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8331678711.1 18 Mar 2024 06:37PM UTC 0
76.07
GitHub Action Run
Source Files on build 8331678711
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #8331678711
  • 13d97ea5 on github
  • Prev Build on main (#8328115604)
  • Next Build on main (#8345894860)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc