Closed dbrgn closed 6 years ago
Also, ToString
(https://doc.rust-lang.org/std/string/trait.ToString.html) might be more appropriate than Into<String>
, but I'm not 100% sure about that.
A good point. I'll make the changes tomorrow when I have some time.
Changed. I'll stick with the Into
because I don't see much reason for ToString
here. Yeah, of course the main use case here is to allow using &str
or String
, not that much anything else. Maybe even Cow
would suffice.
You do need an owned/allocated version of the string though, right?
I think Into is fine.
Yeah, you keep the client alive a long time so forcing it into a lifetime doesn't make sense. Also you hopefully create connections rarely, so allocating from the heap doesn't hurt.
Edit: Sorry, submitted too early due to a new keyboard :)
The Client::token signature currently looks like this:
This requires that key_id and team_id have the same type that implements Into.
What you want is probably this:
This way, the two types can differ, as long as they both impl Into.