Skip to content

Commit

Permalink
Make JSContextRef::wrap_rust_value private
Browse files Browse the repository at this point in the history
While investigating #486
I realized that this function is still public, which shouldn't be the
case as it's only used for wrapping closure types, which is an internal
detail about the crate.
  • Loading branch information
saulecabrera committed Oct 19, 2023
1 parent 6618c2d commit 7a34955
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crates/quickjs-wasm-rs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed
- Make `JSContextRef::wrap_rust_value` private. Similar to
`context::get_rust_value` this function is simply an internal detail.

## [2.0.1] - 2023-09-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion crates/quickjs-wasm-rs/src/js_binding/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl JSContextRef {
}

/// Wrap the specified Rust value in a JS value
pub fn wrap_rust_value<T: 'static>(&self, value: T) -> Result<JSValueRef> {
fn wrap_rust_value<T: 'static>(&self, value: T) -> Result<JSValueRef> {
// Note the use of `RefCell` to provide checked unique references. Since JS values can be arbitrarily
// aliased, we need `RefCell`'s dynamic borrow checking to prevent unsound access.
let pointer = Box::into_raw(Box::new(RefCell::new(value)));
Expand Down

0 comments on commit 7a34955

Please sign in to comment.