@@ -90,13 +90,6 @@ mod strategery;
90
90
use code:: Results ;
91
91
pub use code:: { format_for, get_file_extension, is_support_type, lint_for} ;
92
92
93
- extern crate wasm_bindgen;
94
- use wasm_bindgen:: prelude:: * ;
95
-
96
- extern crate wee_alloc;
97
- #[ global_allocator]
98
- static ALLOC : wee_alloc:: WeeAlloc = wee_alloc:: WeeAlloc :: INIT ;
99
-
100
93
use crate :: strategery:: Strategery ;
101
94
use regex:: Regex ;
102
95
@@ -153,7 +146,6 @@ lazy_static! {
153
146
/// println!("{}", autocorrect::format("既に、世界中の数百という企業が Rust を採用し、高速で低リソースのクロスプラットフォームソリューションを実現しています。"));
154
147
/// // => "既に、世界中の数百という企業が Rust を採用し、高速で低リソースのクロスプラットフォームソリューションを実現しています。"
155
148
/// ```
156
- #[ wasm_bindgen]
157
149
pub fn format ( text : & str ) -> String {
158
150
let mut out = String :: from ( text) ;
159
151
@@ -192,25 +184,10 @@ pub fn format(text: &str) -> String {
192
184
/// "#;
193
185
/// autocorrect::format_html(html);
194
186
/// ```
195
- #[ wasm_bindgen( js_name = "formatHTML" ) ]
196
187
pub fn format_html ( html_str : & str ) -> String {
197
188
code:: format_html ( html_str) . to_string ( )
198
189
}
199
190
200
- /// Format content with filetype, and return a json result.
201
- #[ wasm_bindgen( js_name = "formatFor" ) ]
202
- pub fn format_for_json_out ( raw : & str , filename_or_ext : & str ) -> wasm_bindgen:: JsValue {
203
- let result = format_for ( raw, filename_or_ext) ;
204
- wasm_bindgen:: JsValue :: from_serde ( & result) . unwrap ( )
205
- }
206
-
207
- /// Lint content with filetype, and return a json result.
208
- #[ wasm_bindgen( js_name = "lintFor" ) ]
209
- pub fn lint_for_json_out ( raw : & str , filename_or_ext : & str ) -> wasm_bindgen:: JsValue {
210
- let result = lint_for ( raw, filename_or_ext) ;
211
- wasm_bindgen:: JsValue :: from_serde ( & result) . unwrap ( )
212
- }
213
-
214
191
fn space_dash_with_hans ( text : & str ) -> String {
215
192
let mut out = String :: from ( text) ;
216
193
0 commit comments