Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make JSContextRef::wrap_rust_value private #490

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/javy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = ["wasm"]

[dependencies]
anyhow = { workspace = true }
quickjs-wasm-rs = { version = "2.0.2-alpha.1", path = "../quickjs-wasm-rs" }
quickjs-wasm-rs = { version = "3.0.0-alpha.1", path = "../quickjs-wasm-rs" }
serde_json = { version = "1.0", optional = true }
serde-transcode = { version = "1.1", optional = true }
rmp-serde = { version = "^1.1", optional = true }
Expand Down
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be considered removed? The function is still there, but from the library consumer's point of view, it's a feature that's been removed from the public API. I don't feel strongly about it though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider it, but for someone reading the code, or even comparing differences between both versions, I concluded that this is probably the best wording to capture what happened.

`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/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quickjs-wasm-rs"
version = "2.0.2-alpha.1"
version = "3.0.0-alpha.1"
authors.workspace = true
edition.workspace = true
license.workspace = true
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