Skip to content

Commit 64dbe5b

Browse files
committed
chore: update documentation and clean up unused imports
1 parent b6bbef1 commit 64dbe5b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/core/src/runtime/model/propex.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use std::{
44
ops::{Deref, DerefMut},
55
};
66

7+
use smallvec::SmallVec;
8+
79
use thiserror::Error;
810

911
use crate::text::nom_parsers;
@@ -41,7 +43,7 @@ pub enum PropexSegment<'a> {
4143
#[derive(Debug, Clone, PartialEq)]
4244
pub enum PropexPath<'a> {
4345
Single(PropexSegment<'a>),
44-
Multiple(Vec<PropexSegment<'a>>),
46+
Multiple(SmallVec<[PropexSegment<'a>; 4]>),
4547
}
4648

4749
impl<'a> PropexPath<'a> {
@@ -228,7 +230,7 @@ fn expression(input: &str) -> IResult<&str, PropexPath, nom::error::Error<&str>>
228230
.parse(input)?;
229231

230232
if let Some(rest) = rest {
231-
let mut result = Vec::with_capacity(rest.len() + 1);
233+
let mut result = SmallVec::with_capacity(rest.len() + 1);
232234
result.push(first);
233235
result.extend(rest);
234236
Ok((input, PropexPath::Multiple(result)))

0 commit comments

Comments
 (0)