Skip to content

Commit

Permalink
🐎 Avoid unnecessary heap allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Sep 27, 2023
1 parent 16c88b1 commit 7a3a755
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/archive/entry/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::util::try_to_string;
use std::error::Error;
use std::ffi::OsStr;
use std::fmt::{self, Display, Formatter};
use std::path::{Component, Path, PathBuf};
use std::path::{Component, Path};
use std::str;

/// A UTF-8 encoded entry name.
Expand Down Expand Up @@ -67,7 +67,7 @@ impl EntryName {
}

pub fn from_str_lossy(s: &str) -> Self {
Self::from_path_lossy(&PathBuf::from(s))
Self::from_path_lossy(s.as_ref())
}
}

Expand Down

0 comments on commit 7a3a755

Please sign in to comment.