4 ms·
like C++, rust frees values once they've gone out of scope; the result of CString::new(filename.as_str()).unwrap() is a temporary which is freed at the en
by remexre 6y ago
like C++, rust frees values once they've gone out of scope; the result of
CString::new(filename.as_str()).unwrap()
is a temporary which is freed at the end of that line, since the .as_ptr() returns a non-lifetime-encumbered value.