Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rscarson committed May 16, 2024
1 parent bcee3d7 commit c9cfa62
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 99 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
- name: Run web tests
run: cargo test --features "web"

- name: Run clippy
run: cargo clippy

- name: Check if the README is up to date.
run: |
cargo install cargo-rdme
Expand Down
130 changes: 36 additions & 94 deletions 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 examples/call_rust_from_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() -> Result<(), Error> {
// Let's get a new runtime and register a rust callback
let mut runtime = Runtime::new(Default::default())?;
runtime.register_function("setValue", |args, state| {
if let Some(value) = args.get(0) {
if let Some(value) = args.first() {
let value: String = serde_json::from_value(value.clone())?;
state.put(value);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/module_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() -> Result<(), Error> {
);

// Or ensure a given export is a function
assert_eq!(module.is_callable("addBook"), true);
assert!(module.is_callable("addBook"));

// We can grab constants
let value: String = module.get("MY_FAVOURITE_FOOD")?;
Expand Down

0 comments on commit c9cfa62

Please sign in to comment.