Skip to content

Commit b512cfc

Browse files
fix: result types extraction fn
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
1 parent 07f78d0 commit b512cfc

File tree

1 file changed

+3
-3
lines changed
  • crates/spidermonkey-embedding-splicer/src

1 file changed

+3
-3
lines changed

crates/spidermonkey-embedding-splicer/src/bindgen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ impl JsBindgen<'_> {
905905
}
906906
}
907907

908-
let err = if get_thrown_type(self.resolve, func.result)
908+
let err = if get_result_types(self.resolve, func.result)
909909
.is_some_and(|(_, err_ty)| err_ty.is_some())
910910
{
911911
match abi {
@@ -1347,8 +1347,8 @@ fn binding_name(func_name: &str, iface_name: &Option<String>) -> String {
13471347
}
13481348
}
13491349

1350-
/// Utility function for deducing whether a type can throw
1351-
pub fn get_thrown_type<'a>(
1350+
/// Extract success and error types from a given optional type, if it is a Result
1351+
pub fn get_result_types<'a>(
13521352
resolve: &'a Resolve,
13531353
return_type: Option<Type>,
13541354
) -> Option<(Option<&'a Type>, Option<&'a Type>)> {

0 commit comments

Comments
 (0)