Remove pub(crate)

This commit is contained in:
Jef 2018-12-11 13:04:37 +01:00
parent c8bae0f4b1
commit 9fa0722cf6
2 changed files with 18 additions and 15 deletions

View File

@ -137,7 +137,7 @@ extern crate libm;
#[derive(Debug)]
pub struct Trap {
// Needs to be `pub(crate)` to allow `if let` matching in tests
pub(crate) kind: TrapKind,
kind: TrapKind,
}
impl Trap {

View File

@ -338,21 +338,24 @@ fn resume_call_host_func_type_mismatch() {
}
assert!(invocation.is_resumable());
match invocation
.resume_execution(val, &mut env)
.unwrap_err()
{
ResumableError::Trap(Trap {
kind: TrapKind::UnexpectedSignature,
}) => {
// success
let err = invocation.resume_execution(val, &mut env).unwrap_err();
match &err {
ResumableError::Trap(trap) => {
if let TrapKind::UnexpectedSignature = trap.kind() {
return;
}
}
other => panic!(
"Expected `ResumableError::Trap(Trap {{ kind: \
TrapKind::UnexpectedSignature, }})`, got `{:?}`",
other
),
};
_ => {}
}
// If didn't return in the previous `match`...
panic!(
"Expected `ResumableError::Trap(Trap {{ kind: \
TrapKind::UnexpectedSignature, }})`, got `{:?}`",
err
)
}
resume_with_val(None);