@@ -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" ) ]
198198pub 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" ) ]
205205pub 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" ) ]
211211pub 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" ) ]
220220pub 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" ) ]
225225pub 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" ) ]
234234pub 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