pub trait Optimize {
// Required method
fn optimize(values: &[Self]) -> Vec<&Self>
where Self: Sized;
}Expand description
Deduplicates modal Gerber state commands.
In RS-274X several codes are modal — once set, they remain active until
explicitly changed. Emitting the same SelectAperture, InterpolationMode,
or QuadrantMode command twice in a row is legal but redundant.
Optimize::optimize strips the duplicates, shrinking the output file.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".