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 // Presumably we're using the library in the way it's intended, so this
// might be sound? // might be sound?
unsafe { unsafe { validate_model(export_file_path_str) }
validate_model(export_file_path_str).with_context(|| { .with_context(|| format!("Could not validate model `{model}`"))?;
format!("Could not validate model `{model}`")
})?;
}
} }
Ok(()) Ok(())