this post was submitted on 26 Jul 2023
39 points (97.6% liked)
Rust Programming
8140 readers
62 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Well, actually I would tend to agree that &[T] is preferable to AsRef in most cases; all of the smart pointers you mentioned can also easily be turned into plain references. I probably could have chosen a better example.