-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No alloc #4
No alloc #4
Conversation
Can you rebase this please ? |
Btw I think we shouldn't try to be too clever and just implement the default PartialEq + From<&str> |
yeap
what do you mean by that? the PokemonUuid type should just implement a very small set of traits? |
I don't see the point of having custom PartialEq implementations.
Juste having the default one with #derive should be enough. With From<&str>
implemented we can then use the default PartialEq against &str too by
calling From on it.
…On Sat, 29 Apr 2017 at 14:40, chpio ***@***.***> wrote:
Can you rebase this please ?
yeap
Btw I think we shouldn't try to be too clever and just implement the
default PartialEq + From<&str>
what do you mean by that? the PokemonUuid type should just implement a
very small set of traits?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANm3lhYz7mrd0AvHcWkhoffcTAZQLbXks5r0y-vgaJpZM4NMOTx>
.
|
are you referring to something like this one: uuid_to_pokemon(u).into() == "foo bar" uuid_to_pokemon returning a PokemonUuid and then converting it into a string? |
More like uuid_to_pokemon(u) == From::from("foo bar")
…On Sat, 29 Apr 2017 at 14:47, chpio ***@***.***> wrote:
are you referring to something like this one:
uuid_to_pokemon(u).into() == "foo bar"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANm3vPIMCmbZtkvdF_lCIAiAvd6Ae6yks5r0zFUgaJpZM4NMOTx>
.
|
PokemonUuid::parse_str("foo bar").unwrap() before (my 1. version):
after:
|
shit, it wasn't done. i had to first fix it for incompatible lifetimes (the |
Return a simple view instead of allocating a new string. It's a (partially) breaking change as the return type changes.
before:
after: