Skip to content

Commit 5ba57e9

Browse files
committed
chore: refactor web to use lib instead of rsonpath
1 parent 25607c4 commit 5ba57e9

12 files changed

Lines changed: 208 additions & 943 deletions

File tree

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[build]
1+
[target.'cfg(not(target_arch = "wasm32"))'] # lld is not supported for wasm
22
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
33

44
[alias]

Cargo.lock

Lines changed: 0 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rsonpath-lib/src/classification/simd.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ pub(crate) fn configure() -> SimdConfiguration {
570570
// without simd128 we require the target_feature on compile-time to enable SIMD.
571571
else if #[cfg(all(target_arch = "wasm32", target_feature = "simd128"))]
572572
{
573-
let highest_simd = SimdTag::SimdWasm32;
573+
let highest_simd = SimdTag::WasmSimd128;
574574
let fast_quotes = false;
575575
let fast_popcnt = true; // popcnt is built-in on Wasm32
576576
}
@@ -968,7 +968,9 @@ cfg_if! {
968968
let conf = $conf;
969969

970970
match conf.highest_simd() {
971-
$crate::classification::simd::SimdTag::Wasm32 => {
971+
$crate::classification::simd::SimdTag::WasmSimd128 => {
972+
assert!(!conf.fast_quotes());
973+
assert!(conf.fast_popcnt());
972974
let $simd = $crate::classification::simd::ResolvedSimd::<
973975
$crate::classification::quotes::nosimd::Constructor,
974976
$crate::classification::structural::nosimd::Constructor,

crates/rsonpath/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ log = { workspace = true }
3131
rsonpath-lib = { workspace = true }
3232
rsonpath-syntax = { workspace = true, features = ["color"] }
3333
simple_logger = "5.1.0"
34-
web-time = "1.0"
3534

3635
[build-dependencies]
3736
rustflags = { version = "0.1.7" }
@@ -48,6 +47,3 @@ simd = ["rsonpath-lib/simd"]
4847

4948
[lints]
5049
workspace = true
51-
52-
[lib]
53-
path = "src/lib.rs"

crates/rsonpath/src/args.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use clap::{Parser, ValueEnum};
77
/// Blazing fast JSONPath CLI tool powered by SIMD.
88
///
99
/// A usage guide is available at <https://v0ldek.github.io/rsonpath/>.
10-
pub struct Args {
10+
pub(super) struct Args {
1111
/// JSONPath query to run against the input JSON.
1212
pub query: String,
1313
/// Input JSON file to query.
@@ -41,7 +41,7 @@ pub struct Args {
4141
}
4242

4343
#[derive(ValueEnum, Debug, Clone, Copy, PartialEq, Eq)]
44-
pub enum ResultArg {
44+
pub(super) enum ResultArg {
4545
/// Return only the number of matches.
4646
Count,
4747
/// Return a list of all bytes at which a match occurred.
@@ -51,7 +51,7 @@ pub enum ResultArg {
5151
}
5252

5353
#[derive(ValueEnum, Debug, Clone, Copy, PartialEq, Eq)]
54-
pub enum InputArg {
54+
pub(super) enum InputArg {
5555
/// Use a memory map over a file.
5656
///
5757
/// This is preferred by default, if available on a given platform.

crates/rsonpath/src/lib.rs

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)