Hacker News new | past | comments | ask | show | jobs | submit login

I guess I’m a bit confused sometimes as what you get when you borrow. Sometimes I can borrow, sometimes I need to call .as_slice() or as_path or as_str



Yeah, so thanks to “Deref coercion” a &Vec<T> will coerce into a &[T] in many places. That’s probably what you’re seeing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: