mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-02 12:35:18 +01:00
13 lines
288 B
Rust
13 lines
288 B
Rust
use wasm_bindgen::JsValue;
|
|
|
|
pub type Result<T, E = JsValue> = std::result::Result<T, E>;
|
|
|
|
/// Helper to replace the `E` to `Error` to `napi::Error` conversion.
|
|
#[inline]
|
|
pub fn into_err<E>(error: E) -> JsValue
|
|
where
|
|
E: std::fmt::Display,
|
|
{
|
|
JsValue::from_str(&error.to_string())
|
|
}
|