Don't copy short-lived strings from libxml2 when moving to Rust
We do from_glib_none(some_c_string)
all over the place when a Rust function needs to take a string from C and do something with it. Some of these strings:
- are short-lived; the recipient functions don't need to keep them around
- are known to be valid UTF-8, since they come from libxml2
We now have a util::utf8_cstr(*const libc::c_char) -> &str
function that can get a &str
from such a C string without allocations.
The task is to find the places where we call from_glib_none(c_string)
and see if we can replace them with utf8_cstr()
.