Skip to content

Commit

Permalink
Fix cast
Browse files Browse the repository at this point in the history
  • Loading branch information
richarddavison committed Jan 22, 2025
1 parent 9d1dfb3 commit b7014f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/runtime/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl RawRuntime {
}

pub fn is_job_pending(&self) -> bool {
(unsafe { qjs::JS_IsJobPending(self.rt.as_ptr()) }).into()
(unsafe { qjs::JS_IsJobPending(self.rt.as_ptr()) }) as bool
}

pub fn execute_pending_job(&mut self) -> StdResult<bool, *mut qjs::JSContext> {
Expand Down
6 changes: 3 additions & 3 deletions core/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,13 @@ impl<'js> Value<'js> {
/// Check if the value is a function
#[inline]
pub fn is_function(&self) -> bool {
(unsafe { qjs::JS_IsFunction(self.ctx.as_ptr(), self.value) }).into()
(unsafe { qjs::JS_IsFunction(self.ctx.as_ptr(), self.value) }) as bool
}

/// Check if the value is a constructor function
#[inline]
pub fn is_constructor(&self) -> bool {
(unsafe { qjs::JS_IsConstructor(self.ctx.as_ptr(), self.value) }).into()
(unsafe { qjs::JS_IsConstructor(self.ctx.as_ptr(), self.value) }) as bool
}

/// Check if the value is a promise.
Expand All @@ -376,7 +376,7 @@ impl<'js> Value<'js> {
/// Check if the value is an error
#[inline]
pub fn is_error(&self) -> bool {
(unsafe { qjs::JS_IsError(self.ctx.as_ptr(), self.value) }).into()
(unsafe { qjs::JS_IsError(self.ctx.as_ptr(), self.value) }) as bool
}

/// Reference as value
Expand Down
2 changes: 1 addition & 1 deletion core/src/value/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<'js> Function<'js> {

/// Returns whether this function is an constructor.
pub fn is_constructor(&self) -> bool {
(unsafe { qjs::JS_IsConstructor(self.ctx().as_ptr(), self.0.as_js_value()) }).into()
(unsafe { qjs::JS_IsConstructor(self.ctx().as_ptr(), self.0.as_js_value()) }) as bool
}

/// Set whether this function is a constructor or not.
Expand Down

0 comments on commit b7014f7

Please sign in to comment.