borrow opti for now reason

This commit is contained in:
Quaternions 2024-01-10 17:19:08 -08:00
parent f17a1a86a9
commit 360e76177b

View File

@ -1202,7 +1202,10 @@ fn extract_textures(paths:Vec<std::path::PathBuf>,vpk_paths:Vec<std::path::PathB
//search pak list //search pak list
for vpk_index in vpk_list{ for vpk_index in vpk_list{
if let Some(vpk_entry)=vpk_index.tree.get(search_file_name.as_str()){ if let Some(vpk_entry)=vpk_index.tree.get(search_file_name.as_str()){
return Ok(Some(vpk_entry.get()?.to_vec())); return Ok(Some(match vpk_entry.get()?{
std::borrow::Cow::Borrowed(bytes)=>bytes.to_vec(),
std::borrow::Cow::Owned(bytes)=>bytes,
}));
} }
} }
Ok::<Option<Vec<u8>>,anyhow::Error>(None) Ok::<Option<Vec<u8>>,anyhow::Error>(None)