Browse Source

hide error message

main
Trinity POINTARD 11 months ago
parent
commit
c2c79cbc6d
  1. 4
      src/lib.rs

4
src/lib.rs

@ -62,7 +62,7 @@ fn gen_dhkey_scalar(ip: IpAddr, secret: &str) -> NonZeroScalar<NistP256> {
#[wasm_bindgen]
pub fn adv(ip: JsValue, secret: JsValue) -> JsValue {
adv_inner(ip, secret).unwrap_or_else(|v| format!("Fatal error: {}", v).into())
adv_inner(ip, secret).unwrap()
}
pub fn adv_inner(ip: JsValue, secret: JsValue) -> Result<JsValue, &'static str> {
@ -107,7 +107,7 @@ pub fn adv_inner(ip: JsValue, secret: JsValue) -> Result<JsValue, &'static str>
#[wasm_bindgen]
pub fn rec(ip: JsValue, req: JsValue, secret: JsValue) -> JsValue {
rec_inner(ip, req, secret).unwrap_or_else(|v| format!("Fatal error: {}", v).into())
rec_inner(ip, req, secret).unwrap()
}
fn rec_inner(ip: JsValue, req: JsValue, secret: JsValue) -> Result<JsValue, &'static str> {

Loading…
Cancel
Save