Skip to content

Commit

Permalink
Migrate parser code to winnow (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwagner84 authored Nov 19, 2023
1 parent 10916aa commit d147808
Show file tree
Hide file tree
Showing 34 changed files with 3,033 additions and 3,436 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
matrix:
item:
- { name: record_ref, fuzz-dir: crates/pica-record/fuzz, target: fuzz_record_ref, max-total-time: 300 }
- { name: select_query, fuzz-dir: crates/pica-select/fuzz, target: fuzz_query, max-total-time: 300 }
# - { name: select_query, fuzz-dir: crates/pica-select/fuzz, target: fuzz_query, max-total-time: 300 }
steps:
- uses: actions/checkout@v4
- uses: abbbi/github-actions-tune@v1
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ serde_json = "1.0"
sha2 = "0.10"
thiserror = "1.0"
toml = "0.8"
winnow = "0.5"

[profile.release]
codegen-units = 1
Expand Down
8 changes: 4 additions & 4 deletions crates/pica-lint/src/lints/refcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Lint for RefCheck {

if insert {
for value in values {
self.seen.insert(value.to_owned().into());
self.seen.insert(value.to_owned());
}
}
}
Expand All @@ -48,9 +48,9 @@ impl Lint for RefCheck {
for value in values {
let idn = record.idn().unwrap().to_owned();
self.unseen
.entry(value.to_owned().into())
.and_modify(|e| e.push(idn.into()))
.or_insert_with(|| vec![idn.into()]);
.entry(value.to_owned())
.and_modify(|e| e.push(idn.clone()))
.or_insert_with(|| vec![idn]);
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/pica-matcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ edition.workspace = true

[dependencies]
bstr = { workspace = true }
nom = { workspace = true }
pica-record = { workspace = true }
regex = { workspace = true }
serde = { workspace = true, optional = true }
strsim = "0.10"
thiserror = { workspace = true }
winnow = { workspace = true, features = ["simd"] }

[dev-dependencies]
anyhow = "1.0"
criterion = { version = "0.5", features = ["html_reports"] }
nom-test-helpers = "6.1"

[features]
serde = ["dep:serde"]
Loading

0 comments on commit d147808

Please sign in to comment.