Fix build: ControlSnapshot has no Debug, expect_err needs it

Result::expect_err requires the Ok variant to implement Debug for its
panic message. ControlSnapshot intentionally does not derive Debug;
match on the Result instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-08 14:07:51 +02:00
commit 2d65785790

View file

@ -7394,7 +7394,10 @@ mod tests {
}],
)?);
let error = ControlSnapshot::read(&path).expect_err("foreign encoding must be refused");
let error = match ControlSnapshot::read(&path) {
Ok(_) => panic!("foreign encoding must be refused"),
Err(error) => error,
};
assert!(
format!("{error:#}").contains("noncanonical"),
"unexpected error: {error:#}"