Skip to content

Commit

Permalink
cargo fmt --all
Browse files Browse the repository at this point in the history
  • Loading branch information
dherman committed Jul 8, 2024
1 parent b61cf2e commit f74ab35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 7 additions & 3 deletions crates/neon/src/types_impl/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use crate::{
handle::Handle,
object::Object,
result::{JsResult, NeonResult},
types::{extract::{TryFromJs, TryIntoJs}, JsFunction, JsObject, JsValue, Value},
types::{
extract::{TryFromJs, TryIntoJs},
JsFunction, JsObject, JsValue, Value,
},
};

pub(crate) mod private;
Expand Down Expand Up @@ -41,8 +44,9 @@ impl<'a, 'cx: 'a, C: Context<'cx>> BindOptions<'a, 'cx, C> {

/// Add an argument to the arguments list, computed from a closure.
pub fn arg_with<R, F>(&mut self, f: F) -> NeonResult<&mut Self>
where R: TryIntoJs<'cx>,
F: FnOnce(&mut C) -> NeonResult<R>
where
R: TryIntoJs<'cx>,
F: FnOnce(&mut C) -> NeonResult<R>,
{
let v = f(self.cx)?.try_into_js(self.cx)?;
self.args.push(v.upcast());
Expand Down
5 changes: 1 addition & 4 deletions test/napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ fn main(mut cx: ModuleContext) -> NeonResult<()> {
"call_js_function_idiomatically",
call_js_function_idiomatically,
)?;
cx.export_function(
"call_js_function_with_bind",
call_js_function_with_bind
)?;
cx.export_function("call_js_function_with_bind", call_js_function_with_bind)?;
cx.export_function(
"call_js_function_with_zero_args",
call_js_function_with_zero_args,
Expand Down

0 comments on commit f74ab35

Please sign in to comment.