summaryrefslogtreecommitdiff
path: root/core/modules.rs
diff options
context:
space:
mode:
authorAndreu Botella <andreu@andreubotella.com>2022-05-13 10:36:31 +0200
committerGitHub <noreply@github.com>2022-05-13 10:36:31 +0200
commit3e7afb8918fd0f6cedf839a7ebaae6aaee5e66ad (patch)
tree7fcc92da290889d3d2290f6e4902ac60685aae87 /core/modules.rs
parent0ee76da07b12fba38962634e65853d73adf9d4c0 (diff)
chore(runtime): Make some ops in ext and runtime infallible. (#14589)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'core/modules.rs')
-rw-r--r--core/modules.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/modules.rs b/core/modules.rs
index aa7af64e3..8c4f25d48 100644
--- a/core/modules.rs
+++ b/core/modules.rs
@@ -1141,7 +1141,6 @@ impl ModuleMap {
#[cfg(test)]
mod tests {
use super::*;
- use crate::error::AnyError;
use crate::Extension;
use crate::JsRuntime;
use crate::RuntimeOptions;
@@ -1474,10 +1473,10 @@ import "/a.js";
static DISPATCH_COUNT: AtomicUsize = AtomicUsize::new(0);
#[op]
- fn op_test(_: &mut OpState, control: u8) -> Result<u8, AnyError> {
+ fn op_test(control: u8) -> u8 {
DISPATCH_COUNT.fetch_add(1, Ordering::Relaxed);
assert_eq!(control, 42);
- Ok(43)
+ 43
}
let ext = Extension::builder().ops(vec![op_test::decl()]).build();