Skip to content

Commit

Permalink
js: change KeySendArgs destination from String to &str
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Jan 23, 2024
1 parent 68f3f62 commit 6369e81
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webln-js/src/keysend.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2024 Yuki Kishimoto
// Distributed under the MIT software license

use alloc::string::String;
use core::ops::Deref;
use core::str::FromStr;

Expand All @@ -26,8 +25,8 @@ impl Deref for JsKeysendArgs {

#[wasm_bindgen(js_class = KeysendArgs)]
impl JsKeysendArgs {
pub fn new(destination: String, amount: u32) -> Result<JsKeysendArgs> {
let destination: PublicKey = PublicKey::from_str(&destination).map_err(into_err)?;
pub fn new(destination: &str, amount: u32) -> Result<JsKeysendArgs> {
let destination: PublicKey = PublicKey::from_str(destination).map_err(into_err)?;
let amount: u64 = amount as u64;
Ok(Self {
inner: KeysendArgs {
Expand Down

0 comments on commit 6369e81

Please sign in to comment.