feat: Migrate to stable rust (#300)
This commit is contained in:
committed by
GitHub
parent
2b6ace888d
commit
e64d2e2a55
Generated
-1
@@ -666,7 +666,6 @@ name = "fff-query-parser"
|
||||
version = "0.2.4"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
"smallvec",
|
||||
"zlob",
|
||||
]
|
||||
|
||||
|
||||
+1
-5
@@ -43,11 +43,7 @@ parking_lot = "0.12"
|
||||
pathdiff = "0.2.1"
|
||||
rayon = "1.8.0"
|
||||
regex = "1.11"
|
||||
smallvec = { version = "1.13", features = [
|
||||
"const_generics",
|
||||
"union",
|
||||
"may_dangle",
|
||||
] }
|
||||
smallvec = { version = "1.13", features = ["const_generics", "union"] }
|
||||
thiserror = "2.0.10"
|
||||
tracing = "0.1"
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ default = []
|
||||
zlob = ["dep:zlob"]
|
||||
|
||||
[dependencies]
|
||||
smallvec = { workspace = true }
|
||||
zlob = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use smallvec::SmallVec;
|
||||
|
||||
/// Constraint types that can be extracted from a query
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Constraint<'a> {
|
||||
@@ -45,5 +43,5 @@ pub enum GitStatusFilter {
|
||||
Unmodified,
|
||||
}
|
||||
|
||||
/// Stack-allocated buffer for text parts (up to 16 parts without heap allocation)
|
||||
pub(crate) type TextPartsBuffer<'a> = SmallVec<[&'a str; 16]>;
|
||||
/// Buffer for text parts during query parsing.
|
||||
pub(crate) type TextPartsBuffer<'a> = Vec<&'a str>;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
//! Fast, zero-allocation query parser for file search
|
||||
//! Fast query parser for file search
|
||||
//!
|
||||
//! This parser takes a search query and extracts structured constraints
|
||||
//! while preserving text for fuzzy matching. Designed for maximum performance:
|
||||
//! - Zero allocations for queries with ≤8 constraints (SmallVec)
|
||||
//! - Single-pass parsing with minimal branching
|
||||
//! - Stack-allocated string buffers
|
||||
//!
|
||||
@@ -51,10 +50,7 @@ pub use constraints::{Constraint, GitStatusFilter};
|
||||
pub use location::Location;
|
||||
pub use parser::{FFFQuery, FuzzyQuery, QueryParser};
|
||||
|
||||
// Re-export SmallVec for convenience
|
||||
pub use smallvec::SmallVec;
|
||||
|
||||
pub type ConstraintVec<'a> = SmallVec<[Constraint<'a>; 8]>;
|
||||
pub type ConstraintVec<'a> = Vec<Constraint<'a>>;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
@@ -212,11 +208,10 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_no_heap_allocation_for_small_queries() {
|
||||
fn test_small_constraint_count() {
|
||||
let parser = QueryParser::default();
|
||||
let result = parser.parse("*.rs *.toml !test");
|
||||
// SmallVec should not have spilled to heap
|
||||
assert!(!result.constraints.spilled());
|
||||
assert_eq!(result.constraints.len(), 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1105,7 +1105,7 @@ mod tests {
|
||||
));
|
||||
assert_eq!(
|
||||
result.fuzzy_query,
|
||||
FuzzyQuery::Parts(smallvec::smallvec!["src", "components"])
|
||||
FuzzyQuery::Parts(vec!["src", "components"])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Generated
+9
-9
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"crane": {
|
||||
"locked": {
|
||||
"lastModified": 1773189535,
|
||||
"narHash": "sha256-E1G/Or6MWeP+L6mpQ0iTFLpzSzlpGrITfU2220Gq47g=",
|
||||
"lastModified": 1773857772,
|
||||
"narHash": "sha256-5xsK26KRHf0WytBtsBnQYC/lTWDhQuT57HJ7SzuqZcM=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "6fa2fb4cf4a89ba49fc9dd5a3eb6cde99d388269",
|
||||
"rev": "b556d7bbae5ff86e378451511873dfd07e4504cd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -35,11 +35,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1773597492,
|
||||
"narHash": "sha256-hQ284SkIeNaeyud+LS0WVLX+WL2rxcVZLFEaK0e03zg=",
|
||||
"lastModified": 1773628058,
|
||||
"narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a07d4ce6bee67d7c838a8a5796e75dff9caa21ef",
|
||||
"rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -64,11 +64,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773716879,
|
||||
"narHash": "sha256-vXCTasEzzTTd0ZGEuyle20H2hjRom66JeNr7i2ktHD0=",
|
||||
"lastModified": 1773803479,
|
||||
"narHash": "sha256-GD6i1F2vrSxbsmbS92+8+x3DbHOJ+yrS78Pm4xigW4M=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "1a9ddeb45c5751b800331363703641b84d1f41f0",
|
||||
"rev": "f17186f52e82ec5cf40920b58eac63b78692ac7c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
+5
-6
@@ -1,10 +1,9 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2026-03-14"
|
||||
channel = "stable"
|
||||
components = [
|
||||
"clippy-preview",
|
||||
"rustfmt-preview",
|
||||
"llvm-tools-preview",
|
||||
"miri",
|
||||
"clippy",
|
||||
"rustfmt",
|
||||
"llvm-tools",
|
||||
"rust-src",
|
||||
"rust-analyzer-preview",
|
||||
"rust-analyzer",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user