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

unicode-org / icu4x / 8331678711 / 1
73%
main: 73%

Build:
DEFAULT BRANCH: main
Ran 18 Mar 2024 06:37PM UTC
Files 900
Run time 24s
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.1

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.

49931 of 65639 relevant lines covered (76.07%)

527080.44 hits per line

Source Files on job 8331678711.1
  • Tree
  • List 0
  • Changed 262
  • Source Changed 1
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8331678711
  • 13d97ea5 on github
  • Prev Job for on main (#8328115604.1)
  • Next Job for on main (#8345894860.1)
  • 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