CAD97 / CAD97/cstr8

Missing conversion to/from `str` with the nul terminator

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I expect these APIs to be available but they are not:

- `fn as_str_with_nul(&self) -> &str`
- `fn from_str_until_nul(v: &str) -> Result<&CStr8, core::ffi::c_str::FromBytesWithNulError>`
- `fn from_str_with_nul(v: &str) -> Result<&CStr8, core::ffi::c_str::FromBytesWithNulError>`
- `unsafe fn from_str_with_nul_unchecked(v: &str) -> &CStr8`

These can be worked around with unnecessary runtime checks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the CStr8 implementation and any existing string-conversion tests; the issue names the four missing APIs: as_str_with_nul, from_str_until_nul, from_str_with_nul, and from_str_with_nul_unchecked. Done means these conversions are available with the listed Result and unsafe signatures, with tests covering their expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.