Replace all CStr usage to Utf8CStr

This commit is contained in:
topjohnwu
2023-06-12 05:59:50 -07:00
parent caae932117
commit cb3ab63815
7 changed files with 97 additions and 62 deletions

View File

@ -155,8 +155,8 @@ impl Cpio {
pub(crate) fn load_from_file(path: &Utf8CStr) -> anyhow::Result<Self> {
eprintln!("Loading cpio: [{}]", path);
let data = MappedFile::open(path.as_ref())?;
Self::load_from_data(data.as_ref())
let file = MappedFile::open(path)?;
Self::load_from_data(file.as_ref())
}
fn dump(&self, path: &str) -> anyhow::Result<()> {