Minimize scope of unsafe block

This commit is contained in:
Hanno Braun 2023-01-26 11:34:28 +01:00
parent 8dc0d5034f
commit d3522e32ae

View File

@ -33,11 +33,8 @@ fn main() -> anyhow::Result<()> {
// Presumably we're using the library in the way it's intended, so this
// might be sound?
unsafe {
validate_model(export_file_path_str).with_context(|| {
format!("Could not validate model `{model}`")
})?;
}
unsafe { validate_model(export_file_path_str) }
.with_context(|| format!("Could not validate model `{model}`"))?;
}
Ok(())