MCPcopy Create free account
hub / github.com/ProgrammingRust/examples / char_ptr_to_str

Function char_ptr_to_str

libgit2-rs-safe/src/git/mod.rs:239–245  ·  view source on GitHub ↗

Try to borrow a `&str` from `ptr`, given that `ptr` may be null or refer to ill-formed UTF-8. Give the result a lifetime as if it were borrowed from `_owner`. Safety: if `ptr` is non-null, it must point to a null-terminated C string that is safe to access for at least as long as the lifetime of `_owner`.

(_owner: &T, ptr: *const c_char)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

messageMethod · 0.85
nameMethod · 0.85
emailMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected