Skip to content

Commit 0c3f732

Browse files
cheapsteakStranger6667
authored andcommitted
refactor: code cleanup
Signed-off-by: Chang Wang <[email protected]>
1 parent 67f5b26 commit 0c3f732

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wasm/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct UrlError(url::ParseError);
1717

1818
impl From<UrlError> for JsValue {
1919
fn from(error: UrlError) -> Self {
20-
wasm_bindgen::throw_str(&error.0.to_string())
20+
JsValue::from_str(&error.0.to_string().as_str())
2121
}
2222
}
2323

@@ -34,7 +34,7 @@ extern crate serde_derive;
3434

3535
#[derive(Deserialize)]
3636
#[serde(default)]
37-
pub struct Options {
37+
struct Options {
3838
inline_style_tags: bool,
3939
remove_style_tags: bool,
4040
base_url: Option<String>,
@@ -79,7 +79,7 @@ impl TryFrom<Options> for rust_inline::InlineOptions<'_> {
7979
#[wasm_bindgen]
8080
pub fn inline(
8181
html: &str,
82-
options: JsValue,
82+
options: &JsValue,
8383
) -> Result<String, JsValue> {
8484
let options: Options = if !options.is_undefined() {
8585
options.into_serde().map_err(SerdeError)?

0 commit comments

Comments
 (0)