Skip to content

Commit b783900

Browse files
committed
Fix str
1 parent 2edb047 commit b783900

File tree

1 file changed

+7
-7
lines changed
  • bindings/devup-ui-wasm/src

1 file changed

+7
-7
lines changed

bindings/devup-ui-wasm/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl Output {
177177
}
178178

179179
Some(sheet.create_css(if self.split_css {
180-
Some(self.filename.as_str())
180+
Some(&self.filename)
181181
} else {
182182
None
183183
}))
@@ -197,42 +197,42 @@ pub fn is_debug() -> bool {
197197
#[wasm_bindgen(js_name = "importSheet")]
198198
pub fn import_sheet(sheet_object: JsValue) -> Result<(), JsValue> {
199199
*GLOBAL_STYLE_SHEET.lock().unwrap() = serde_wasm_bindgen::from_value(sheet_object)
200-
.map_err(|e| JsValue::from_str(e.to_string().as_str()))?;
200+
.map_err(|e| JsValue::from_str(&e.to_string()))?;
201201
Ok(())
202202
}
203203

204204
#[wasm_bindgen(js_name = "exportSheet")]
205205
pub fn export_sheet() -> Result<String, JsValue> {
206206
serde_json::to_string(&*GLOBAL_STYLE_SHEET.lock().unwrap())
207-
.map_err(|e| JsValue::from_str(e.to_string().as_str()))
207+
.map_err(|e| JsValue::from_str(&e.to_string()))
208208
}
209209

210210
#[wasm_bindgen(js_name = "importClassMap")]
211211
pub fn import_class_map(sheet_object: JsValue) -> Result<(), JsValue> {
212212
set_class_map(
213213
serde_wasm_bindgen::from_value(sheet_object)
214-
.map_err(|e| JsValue::from_str(e.to_string().as_str()))?,
214+
.map_err(|e| JsValue::from_str(&e.to_string()))?,
215215
);
216216
Ok(())
217217
}
218218

219219
#[wasm_bindgen(js_name = "exportClassMap")]
220220
pub fn export_class_map() -> Result<String, JsValue> {
221-
serde_json::to_string(&get_class_map()).map_err(|e| JsValue::from_str(e.to_string().as_str()))
221+
serde_json::to_string(&get_class_map()).map_err(|e| JsValue::from_str(&e.to_string()))
222222
}
223223

224224
#[wasm_bindgen(js_name = "importFileMap")]
225225
pub fn import_file_map(sheet_object: JsValue) -> Result<(), JsValue> {
226226
set_file_map(
227227
serde_wasm_bindgen::from_value(sheet_object)
228-
.map_err(|e| JsValue::from_str(e.to_string().as_str()))?,
228+
.map_err(|e| JsValue::from_str(&e.to_string()))?,
229229
);
230230
Ok(())
231231
}
232232

233233
#[wasm_bindgen(js_name = "exportFileMap")]
234234
pub fn export_file_map() -> Result<String, JsValue> {
235-
serde_json::to_string(&get_file_map()).map_err(|e| JsValue::from_str(e.to_string().as_str()))
235+
serde_json::to_string(&get_file_map()).map_err(|e| JsValue::from_str(&e.to_string()))
236236
}
237237

238238
#[wasm_bindgen(js_name = "codeExtract")]

0 commit comments

Comments
 (0)