From daad2dc1519d10914503ba8a7c02044b9e0030ba Mon Sep 17 00:00:00 2001 From: BlackHoleFox Date: Mon, 20 Nov 2023 02:40:44 -0600 Subject: [PATCH] Take string references instead of owned values building Facet paths (#2265) --- src/schema/facet.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schema/facet.rs b/src/schema/facet.rs index 845829b30..d609e8d70 100644 --- a/src/schema/facet.rs +++ b/src/schema/facet.rs @@ -131,16 +131,16 @@ impl Facet { pub fn from_path(path: Path) -> Facet where Path: IntoIterator, - Path::Item: ToString, + Path::Item: AsRef, { 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) }