Function save
pub fn save(artifact: &DefectArtifact, path: &Path) -> Result<()>Expand description
Serialize artifact as compact JSON and write it to path, creating
parent directories as needed.
Mirrors the calibrate command’s write idiom exactly: serde_json::to_vec
(compact, not pretty) so byte-determinism tests over identical inputs are
meaningful, not an artifact of formatting.
§Errors
CodeLoreError::Analysis if serialization fails (should not happen for
a well-formed DefectArtifact); CodeLoreError::Io if the parent
directory cannot be created or the file cannot be written.