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

Implement cstr_count_bytes #114443

Merged
merged 2 commits into from
Sep 20, 2023
Merged

Implement cstr_count_bytes #114443

merged 2 commits into from
Sep 20, 2023

Commits on Aug 29, 2023

  1. Refactor the const strlen implementation to const_strlen

    Currently, `CStr::from_ptr` contains its own implementation of `strlen`
    that uses `const_eval_select` to either call libc's `strlen` or use a
    naive Rust implementation. Refactor that into its own function so we can
    use it elsewhere in the module.
    tgross35 committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    e8f9d1a View commit details
    Browse the repository at this point in the history
  2. Implement CStr::count_bytes

    This is feature gated under `cstr_count_bytes` and provides a more
    straightforward way to access the length of a `CStr`
    
    Link: rust-lang#113219
    tgross35 committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    fe0eb8b View commit details
    Browse the repository at this point in the history