diff --git a/Cargo.toml b/Cargo.toml index f738dc9..f2513d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,11 @@ [workspace] -members = ["crates/*"] +members = ["crates/*"] +resolver = "2" + +[workspace.dependencies] +html5ever = "0.27.0" +indexmap = "2.2.6" +kuchikiki = { git = "https://github.com/xusd320/kuchikiki.git", rev = "c671c7b" } [profile.release] lto = true diff --git a/crates/niddle_napi/Cargo.toml b/crates/niddle_napi/Cargo.toml index c362bc5..2f12006 100644 --- a/crates/niddle_napi/Cargo.toml +++ b/crates/niddle_napi/Cargo.toml @@ -7,9 +7,10 @@ version = "0.0.0" crate-type = ["cdylib"] [dependencies] -html5ever = "0.27.0" -indexmap = "2.2.6" -kuchikiki = { git = "https://github.com/xusd320/kuchikiki.git", rev = "c671c7b" } +html5ever = { workspace = true } +indexmap = { workspace = true } +kuchikiki = { workspace = true } + # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix napi = { version = "3.0.0-alpha.7", default-features = false, features = ["object_indexmap"] } napi-derive = "3.0.0-alpha.6" diff --git a/crates/niddle_napi/src/lib.rs b/crates/niddle_napi/src/lib.rs index 7a911bc..bca0e1a 100644 --- a/crates/niddle_napi/src/lib.rs +++ b/crates/niddle_napi/src/lib.rs @@ -29,11 +29,6 @@ mod tests { #[bench] fn bench_parse(b: &mut Bencher) { let html = include_str!("../../../test/jquery.html").to_string(); - b.iter(|| { - parse(html.clone()) - .select("html".to_string()) - .unwrap() - .outer_html() - }); + b.iter(|| parse(html.to_string())); } }