Skip to content

Commit 66d3a2f

Browse files
authored
V0ldek/nom 8.0.0 (#683)
* deps: bump nom to 8.0.0 There was a bunch of breaking changes in nom 8.0.0. Nom's maintainers claim it reduces code generated by parsers, which is always worth it. It actually seems to improve performance by roughly 10% on compiling small queries. On larger queries the cost of compilation outweighs the cost of parsing so it's not noticable. * chore: clippy lints
1 parent 6f570f4 commit 66d3a2f

File tree

13 files changed

+56
-52
lines changed

13 files changed

+56
-52
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/target/*
2-
/.vscode/*.log
2+
/.vscode/*.log
3+
/.idea

Cargo.lock

+2-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rsonpath-benchmarks/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ memchr = "2.7.4"
5252
[features]
5353
default = ["simd"]
5454
simd = ["rsonpath-lib/simd"]
55+
jsurfer = []
5556

5657
[build-dependencies]
5758
eyre = "0.6.12"

crates/rsonpath-benchmarks/build.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use std::error::Error;
33
use std::process::Command;
44

55
fn main() -> Result<(), Box<dyn Error>> {
6-
setup_jsurfer()?;
6+
if cfg!(feature = "jsurfer") {
7+
setup_jsurfer()?;
8+
}
79

810
Ok(())
911
}

crates/rsonpath-lib/src/automaton.rs

-2
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,13 @@ impl ArrayTransitionLabel {
139139
}
140140

141141
impl From<JsonUInt> for ArrayTransitionLabel {
142-
#[must_use]
143142
#[inline(always)]
144143
fn from(index: JsonUInt) -> Self {
145144
Self::Index(index)
146145
}
147146
}
148147

149148
impl From<SimpleSlice> for ArrayTransitionLabel {
150-
#[must_use]
151149
#[inline(always)]
152150
fn from(slice: SimpleSlice) -> Self {
153151
Self::Slice(slice)

crates/rsonpath-lib/src/automaton/minimizer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct SuperstateTransitionTable {
6363
* 2. Each superstate containing
6464
* a) a checkpoint and;
6565
* b) some states on the path from the initial state to that checkpoint,
66-
* is equivalent to a superstate without the b) states.
66+
* is equivalent to a superstate without the b) states.
6767
*
6868
* This allows on-the-fly minimization with the `normalize` function, vastly reducing
6969
* the number of superstates to consider.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pub trait Memmem<'i, 'b, 'r, I: Input, const N: usize> {
1212
/// Find a member key identified by a given [`StringPattern`].
1313
///
1414
/// - `first_block` &ndash; optional first block to search; if not provided,
15-
/// the search will start at the next block returned by the underlying [`Input`] iterator.
15+
/// the search will start at the next block returned by the underlying [`Input`] iterator.
1616
/// - `start_idx` &ndash; index of the start of search, either falling inside `first_block`,
17-
/// or at the start of the next block.
17+
/// or at the start of the next block.
1818
///
1919
/// # Errors
2020
/// Errors when reading the underlying [`Input`] are propagated.

crates/rsonpath-lib/src/engine.rs

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pub trait Compiler {
110110
/// # Errors
111111
/// An appropriate [`CompilerError`] is returned if the compiler
112112
/// cannot handle the query.
113+
#[must_use = "compiling the query only creates an engine instance that should be used"]
113114
fn compile_query(query: &JsonPathQuery) -> Result<Self::E, CompilerError>;
114115

115116
/// Turn a compiled [`Automaton`] into an [`Engine`].

crates/rsonpath-lib/src/engine/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ impl MainEngine {
8989
impl Compiler for MainEngine {
9090
type E = Self;
9191

92-
#[must_use = "compiling the query only creates an engine instance that should be used"]
9392
#[inline(always)]
9493
fn compile_query(query: &JsonPathQuery) -> Result<Self, CompilerError> {
9594
let automaton = Automaton::new(query)?;

crates/rsonpath-lib/src/input/mmap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
//! 1. Your platform supports memory maps.
66
//! 2. The input data is in a file or comes from standard input:
77
//! a) if from a file, then you can guarantee that the file is not going to be modified
8-
//! in or out of process while the input is alive;
8+
//! in or out of process while the input is alive;
99
//! b) if from stdin, then that the input lives in memory (for example comes via a pipe);
10-
//! input from a tty is not memory-mappable.
10+
//! input from a tty is not memory-mappable.
1111
//!
1212
//! ## Performance characteristics
1313
//!

crates/rsonpath-syntax/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ all-features = true
2020
[dependencies]
2121
arbitrary = { workspace = true, features = ["derive"], optional = true }
2222
owo-colors = { version = "4.1.0", default-features = false, optional = true }
23-
nom = "7.1.3"
23+
nom = "8.0.0"
2424
serde = { workspace = true, optional = true, features = ["derive"] }
2525
thiserror = { workspace = true }
2626
unicode-width = "0.2.0"

crates/rsonpath-syntax/src/builder.rs

-3
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ impl SliceBuilder {
480480

481481
impl From<SliceBuilder> for Slice {
482482
#[inline]
483-
#[must_use]
484483
fn from(mut value: SliceBuilder) -> Self {
485484
value.to_slice()
486485
}
@@ -495,7 +494,6 @@ impl Default for SliceBuilder {
495494
/// assert_eq!(Slice::default(), slice);
496495
/// ```
497496
#[inline(always)]
498-
#[must_use]
499497
fn default() -> Self {
500498
Self::new()
501499
}
@@ -575,7 +573,6 @@ impl Default for SingularJsonPathQueryBuilder {
575573

576574
impl From<SingularJsonPathQueryBuilder> for SingularJsonPathQuery {
577575
#[inline]
578-
#[must_use]
579576
fn from(value: SingularJsonPathQueryBuilder) -> Self {
580577
Self {
581578
segments: value.segments,

0 commit comments

Comments
 (0)