Skip to content

Commit

Permalink
Implement FromStr for BigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-Bertholet committed Jul 23, 2021
1 parent d7c3b74 commit e4273b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/js-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,14 @@ impl Default for BigInt {
}
}

impl FromStr for BigInt {
type Err = Infallible;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(BigInt::new(&s.into()))
}
}

// Boolean
#[wasm_bindgen]
extern "C" {
Expand Down

0 comments on commit e4273b9

Please sign in to comment.