rust-unofficial / patterns

A catalogue of Rust design patterns, anti-patterns and idioms
https://rust-unofficial.github.io/patterns/
Mozilla Public License 2.0
8.11k stars 375 forks source link

Use coercion for arguments #29

Closed cbreeden closed 3 years ago

cbreeden commented 8 years ago

Describe some of the reasons it is considered idiomatic to use &str over &String in most cases.

ref.: #27

cbreeden commented 8 years ago

@lfairy Does this look fine to you?

cbreeden commented 8 years ago

I wonder if this article should be about borrowed types in general (e.g. talk about Vec and &[T] as well)

This is a good point. Let me think about that.

cbreeden commented 8 years ago

@nrc @lfairy Do you like this approach better?

simonsan commented 3 years ago

@lambda-fairy Worked in some fixes from you, would you mind reading over it one last time? ;-)

MarcoIeni commented 3 years ago

Other than the 2 open suggestions I've made it looks good to me.

simonsan commented 3 years ago

LGTM modulo comments

That was a ride 🎢 🙄

:-D

simonsan commented 3 years ago

Thanks for the PR @cbreeden ;-)