-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Description
Bug
apr convert model.apr -o output.apr (without --quantize or --compress) silently copies the file with no transformation. The text output even shows Quantization: None (copy) but no error is raised.
Root Cause
In crates/apr-cli/src/commands/convert.rs, lines 63-64 parse both options but there's no validation that at least one is Some:
let quant_type = parse_quantization(quantize)?; // None
let compress_type = parse_compression(compress)?; // None
// No check that at least one is SomeThe code proceeds to call apr_convert() with ConvertOptions { quantize: None, compress: None }, performing an expensive file copy with no transformation.
Expected Behavior
Should return an error:
Error: At least one of --quantize or --compress must be specified
Fix
Add validation after line 64:
if quant_type.is_none() && compress_type.is_none() {
return Err(CliError::ValidationFailed(
"At least one of --quantize or --compress must be specified".into()
));
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels