Skip to content

Commit 238846b

Browse files
committed
chore: M5 CI/Workflow Sweep - final synchronisation
1 parent 1786652 commit 238846b

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/codegen/audit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ mod tests {
189189
let mut trail = AuditTrail::new(true);
190190
trail.record(sample_result(AuditDecision::Permitted));
191191
trail.record(sample_result(AuditDecision::Denied));
192-
let json = trail.to_json().unwrap();
192+
let json = trail.to_json().expect("TODO: handle error");
193193
assert!(json.contains("Permitted"));
194194
assert!(json.contains("Denied"));
195195
}
@@ -212,10 +212,10 @@ mod tests {
212212
fn test_write_json_to_tempfile() {
213213
let mut trail = AuditTrail::new(true);
214214
trail.record(sample_result(AuditDecision::Permitted));
215-
let dir = tempfile::tempdir().unwrap();
215+
let dir = tempfile::tempdir().expect("TODO: handle error");
216216
let path = dir.path().join("audit.json");
217-
trail.write_json(path.to_str().unwrap()).unwrap();
218-
let content = std::fs::read_to_string(&path).unwrap();
217+
trail.write_json(path.to_str().expect("TODO: handle error")).expect("TODO: handle error");
218+
let content = std::fs::read_to_string(&path).expect("TODO: handle error");
219219
assert!(content.contains("Permitted"));
220220
}
221221
}

src/codegen/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn generate_all(manifest: &Manifest, output_dir: &str) -> Result<()> {
4545
let config_path = format!("{}/engine_config.json", output_dir);
4646
fs::write(
4747
&config_path,
48-
serde_json::to_string_pretty(&engine_config).unwrap(),
48+
serde_json::to_string_pretty(&engine_config).expect("TODO: handle error"),
4949
)
5050
.with_context(|| format!("Failed to write {}", config_path))?;
5151
println!(" [codegen] Wrote {}", config_path);

src/codegen/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ mod tests {
142142
priority: 99,
143143
},
144144
]);
145-
let parsed = parse_constraints(&m).unwrap();
145+
let parsed = parse_constraints(&m).expect("TODO: handle error");
146146
assert_eq!(parsed.constraints[0].name, "high");
147147
assert_eq!(parsed.constraints[1].name, "low");
148148
}

src/manifest/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ audit-log = true
534534
name = "demo-bot"
535535
capabilities = ["chat", "search"]
536536
"#;
537-
let m: Manifest = toml::from_str(toml_str).unwrap();
537+
let m: Manifest = toml::from_str(toml_str).expect("TODO: handle error");
538538
assert_eq!(m.project.name, "ethics-demo");
539539
assert_eq!(m.constraints.len(), 1);
540540
assert_eq!(m.constraints[0].kind, ConstraintKind::Prohibition);

0 commit comments

Comments
 (0)