Skip to content

Conversation

@cbreeden
Copy link
Collaborator

@cbreeden cbreeden commented Sep 23, 2016

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

ref.: #27

@cbreeden cbreeden changed the title Create str-vs-string section String vs str idiom Sep 24, 2016
@cbreeden
Copy link
Collaborator Author

@lfairy Does this look fine to you?

Copy link
Collaborator

@lambda-fairy lambda-fairy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks pretty much good to me, modulo the comments above.

I wonder if this article should be about borrowed types in general (e.g. talk about Vec<T> and &[T] as well), but if you think &String is common enough to deserve its own article then that's fine.

@cbreeden
Copy link
Collaborator Author

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 cbreeden changed the title String vs str idiom Using coercion for arguments Oct 8, 2016
@cbreeden
Copy link
Collaborator Author

cbreeden commented Oct 8, 2016

@nrc @lfairy Do you like this approach better?

@simonsan simonsan added C-addition Category: Adding new content, something that didn't exist in the repository before S-review Status: A PR that is currently under review or where a review is the next step labels Dec 31, 2020
@simonsan simonsan force-pushed the cbreeden-str-vs-string branch from 4c8e651 to 366db72 Compare January 1, 2021 14:15
Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
@marcoieni
Copy link
Collaborator

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

Co-authored-by: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com>
@simonsan simonsan changed the title Using coercion for arguments Use coercion for arguments Jan 4, 2021
Co-authored-by: Ivan Tham <pickfire@riseup.net>
lambda-fairy
lambda-fairy previously approved these changes Jan 4, 2021
Copy link
Collaborator

@lambda-fairy lambda-fairy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo comments

Co-authored-by: Chris Wong <lambda.fairy@gmail.com>
simonsan and others added 2 commits January 4, 2021 09:28
@simonsan simonsan merged commit c232127 into master Jan 4, 2021
@simonsan simonsan deleted the cbreeden-str-vs-string branch January 4, 2021 08:31
@simonsan
Copy link
Collaborator

simonsan commented Jan 4, 2021

LGTM modulo comments

That was a ride 🎢 🙄

:-D

@simonsan
Copy link
Collaborator

simonsan commented Jan 4, 2021

Thanks for the PR @cbreeden ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-addition Category: Adding new content, something that didn't exist in the repository before S-review Status: A PR that is currently under review or where a review is the next step

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants