Skip to content

Commit 1494331

Browse files
committed
fix: reorder imports and add scheduling to NIF functions
1 parent 068c1c9 commit 1494331

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

native/htmd_nif/src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use htmd::{HtmlToMarkdown, options::*};
2-
use rustler::{Atom, NifResult, NifTuple, NifStruct};
1+
use htmd::{options::*, HtmlToMarkdown};
2+
use rustler::{Atom, NifResult, NifStruct, NifTuple};
33

44
mod atoms {
55
rustler::atoms! {
@@ -195,7 +195,6 @@ impl From<ConvertOptions> for Options {
195195
options.bullet_list_marker = bullet_list_marker_from_atom(bullet_list_marker);
196196
}
197197

198-
199198
if let Some(preformatted_code) = opts.preformatted_code {
200199
options.preformatted_code = preformatted_code;
201200
}
@@ -204,7 +203,7 @@ impl From<ConvertOptions> for Options {
204203
}
205204
}
206205

207-
#[rustler::nif]
206+
#[rustler::nif(schedule = "DirtyCpu")]
208207
fn convert(html: String) -> NifResult<Response> {
209208
let converter = HtmlToMarkdown::new();
210209
match converter.convert(&html) {
@@ -219,7 +218,7 @@ fn convert(html: String) -> NifResult<Response> {
219218
}
220219
}
221220

222-
#[rustler::nif]
221+
#[rustler::nif(schedule = "DirtyCpu")]
223222
fn convert_with_options(html: String, options: ConvertOptions) -> NifResult<Response> {
224223
// Extract skip_tags before moving options
225224
let skip_tags = options.skip_tags.clone();

0 commit comments

Comments
 (0)