-
Notifications
You must be signed in to change notification settings - Fork 13k
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
std::str: stop from_utf8 allocating. #10701
Conversation
So, to maintain the same semantics—where what In cases where auto-slicing was employed (i.e. where the argument was actually |
(It's probably being removed, see rust-lang/rust#10701.)
I'm a little concerned about this, on one hand it seems unfortunate that we're making this fairly common api more difficult to use, but on the other hand I like how this is much more explicit about storage needs. It'd be awesome if we had the same storage benefits from using only |
By more difficult to use you mean "one has to work out if one wants a FWIW, I think it's not that bad, as one can see from this change just using |
I just added a commit that renames what was |
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
…, r=llogiq Bugfix: Ignore `impl Trait`(s) @ `let_underscore_untyped` Fixes rust-lang#10411 changelog:[`let_underscore_untyped`]: Ignore `impl Trait`(s) that caused false positives.
This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.