Skip to content

Commit

Permalink
Reformat Rust files.
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Dec 9, 2024
1 parent 8a6a71e commit 72abe77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 6 additions & 8 deletions rust/crates/langsmith-nodejs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ impl TracingClient {
// TODO: this is for debugging only, remove it before publishing
println!("Rust bindings received run: {run:?}");

self.client
.submit_run_create(run.into_inner())
.map_err(|e| {
// TODO: this is for debugging only, remove it before publishing
println!("Submitting run failed with error: {e:?}");

napi::Error::from_reason(format!("{e}"))
})
self.client.submit_run_create(run.into_inner()).map_err(|e| {
// TODO: this is for debugging only, remove it before publishing
println!("Submitting run failed with error: {e:?}");

napi::Error::from_reason(format!("{e}"))
})
}
}
9 changes: 5 additions & 4 deletions rust/crates/langsmith-nodejs/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use napi::{bindgen_prelude::FromNapiValue, Env, JsUnknown, NapiValue};

#[derive(Debug, serde::Deserialize)]
#[serde(transparent)]
pub struct RunCreateExtended(
langsmith_tracing_client::client::RunCreateExtended,
);
pub struct RunCreateExtended(langsmith_tracing_client::client::RunCreateExtended);

impl RunCreateExtended {
#[inline]
Expand All @@ -14,7 +12,10 @@ impl RunCreateExtended {
}

impl FromNapiValue for RunCreateExtended {
unsafe fn from_napi_value(napi_env: napi::sys::napi_env, napi_val: napi::sys::napi_value) -> napi::Result<Self> {
unsafe fn from_napi_value(
napi_env: napi::sys::napi_env,
napi_val: napi::sys::napi_value,
) -> napi::Result<Self> {
let env = Env::from_raw(napi_env);
let value = JsUnknown::from_raw(napi_env, napi_val)?;
env.from_js_value(value)
Expand Down

0 comments on commit 72abe77

Please sign in to comment.