From 886568c4c53d030109709ca6d39d42df197abae7 Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Mon, 24 Jun 2024 09:31:04 +0800 Subject: [PATCH] deps: enable smallvec const_new feature --- Cargo.toml | 2 +- src/node.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a261db9..2b6611e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ include = [ ] [dependencies] -smallvec = "1.13.2" +smallvec = { version = "1.13.2", features = ["const_new"] } [dev-dependencies] bytes = "1" diff --git a/src/node.rs b/src/node.rs index 5c9d1ab..61ed5a0 100644 --- a/src/node.rs +++ b/src/node.rs @@ -384,7 +384,7 @@ impl Node { } pub fn find(&self, bytes: &[u8]) -> Option<(&T, SmallVec<[Range; 8]>)> { - let mut ranges = SmallVec::<[Range; 8]>::new(); // opt! + let mut ranges = SmallVec::<[Range; 8]>::new_const(); // opt! return self._find(0, bytes, &mut ranges).map(|t| (t, ranges)); } }