Use matches macro

This commit is contained in:
Collin Chin 2020-10-27 10:06:50 -07:00 committed by GitHub
parent 46f585e2ff
commit 1a39ae93ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,21 +182,11 @@ pub(crate) fn expect_compiler_error(program: EdwardsTestCompiler) -> CompilerErr
} }
pub(crate) fn expect_dynamic_check_error(error: CompilerError) { pub(crate) fn expect_dynamic_check_error(error: CompilerError) {
let is_dynamic_check = match error { assert!(matches!(error, CompilerError::DynamicCheckError(_)))
CompilerError::DynamicCheckError(_) => true,
_ => false,
};
assert!(is_dynamic_check)
} }
pub(crate) fn expect_static_check_error(error: CompilerError) { pub(crate) fn expect_static_check_error(error: CompilerError) {
let is_static_check = match error { assert!(matches!(error, CompilerError::StaticCheckError(_)))
CompilerError::StaticCheckError(_) => true,
_ => false,
};
assert!(is_static_check)
} }
pub(crate) fn generate_main_input(input: Vec<(&str, Option<InputValue>)>) -> MainInput { pub(crate) fn generate_main_input(input: Vec<(&str, Option<InputValue>)>) -> MainInput {