Why does this need a separate function? Can't it be

```rust
let file_str = match unsafe {CString::new(file as *c_char, false)}.as_str() {
    Some(s) => ...,
    None => ...
};
```