We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7caeb31 commit c2f6b00Copy full SHA for c2f6b00
crates/js-sys/src/lib.rs
@@ -18,9 +18,11 @@
18
19
#![doc(html_root_url = "https://docs.rs/js-sys/0.2")]
20
21
+use std::convert;
22
use std::f64;
23
use std::fmt;
24
use std::mem;
25
+use std::str;
26
27
use wasm_bindgen::prelude::*;
28
use wasm_bindgen::JsCast;
@@ -4297,6 +4299,13 @@ impl fmt::Debug for JsString {
4297
4299
}
4298
4300
4301
4302
+impl str::FromStr for JsString {
4303
+ type Err = convert::Infallible;
4304
+ fn from_str(s: &str) -> Result<Self, Self::Err> {
4305
+ Ok(JsString::from(s))
4306
+ }
4307
+}
4308
+
4309
// Symbol
4310
#[wasm_bindgen]
4311
extern "C" {
0 commit comments