Open eliad-wiz opened 1 year ago
Thanks for the PR. IIRC, I implemented Valuable
for the reference to match the Valuable
implementation of str
.
the &str impl uses some specific optimization for slices:
impl Valuable for &'_ str {
fn as_value(&self) -> Value<'_> {
Value::String(self)
}
fn visit(&self, visit: &mut dyn Visit) {
visit.visit_value(Value::String(self));
}
fn visit_slice(slice: &[Self], visit: &mut dyn Visit)
where
Self: Sized,
{
visit.visit_primitive_slice(Slice::Str(slice));
}
}
Path is not a primitive type, so i guess it's different.
(btw, currently the implementation for Box
implement valuable for Path instead of &Path, in order to support types like Box