Skip to content

Commit 6999fdd

Browse files
committed
reduce empty allocation
1 parent 84172ed commit 6999fdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn component_vec_to_path_buf(components: ComponentVec) -> PathBuf {
8484

8585
pub fn to_normalized_components<'a>(path: &'a Path) -> ComponentVec<'a> {
8686
let mut components = path.components().peekable();
87-
let mut ret = SmallVec::with_capacity(components.size_hint().1.unwrap_or(0));
87+
let mut ret = SmallVec::with_capacity(components.size_hint().1.unwrap_or(8));
8888
if let Some(c @ Component::Prefix(..)) = components.peek() {
8989
ret.push(*c);
9090
components.next();

0 commit comments

Comments
 (0)