Skip to content

Commit

Permalink
Take string references instead of owned values building Facet paths (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackHoleFox authored Nov 20, 2023
1 parent 054f49d commit daad2dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schema/facet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,16 @@ impl Facet {
pub fn from_path<Path>(path: Path) -> Facet
where
Path: IntoIterator,
Path::Item: ToString,
Path::Item: AsRef<str>,
{
let mut facet_string: String = String::with_capacity(100);
let mut step_it = path.into_iter();
if let Some(step) = step_it.next() {
facet_string.push_str(&step.to_string());
facet_string.push_str(step.as_ref());
}
for step in step_it {
facet_string.push(FACET_SEP_CHAR);
facet_string.push_str(&step.to_string());
facet_string.push_str(step.as_ref());
}
Facet(facet_string)
}
Expand Down

0 comments on commit daad2dc

Please sign in to comment.