Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • kernel
  • str.rs
Find file BlameHistoryPermalink
  • Alice Ryhl's avatar
    rust: str: add conversion from `CStr` to `CString` · 66bd7533
    Alice Ryhl authored May 03, 2023
    
    
    These methods can be used to copy the data in a temporary c string into
    a separate allocation, so that it can be accessed later even if the
    original is deallocated.
    
    The API in this change mirrors the standard library API for the `&str`
    and `String` types. The `ToOwned` trait is not implemented because it
    assumes that allocations are infallible.
    
    Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
    Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
    Reviewed-by: default avatarMartin Rodriguez Reboredo <yakoyoku@gmail.com>
    Reviewed-by: default avatarAndreas Hindborg <a.hindborg@samsung.com>
    Link: https://lore.kernel.org/r/20230503141016.683634-1-aliceryhl@google.com
    
    
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    66bd7533
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7