Repository navigation
std.string: str.rfind, trim_start/trim_end as views, bytes() (D105, #2206) - #2227
Merged
Merged
Conversation
…2206) Three `impl str` methods beside `as_bytes`, no intrinsics: `rfind` is `find` from the other end (-1 when absent, an empty needle at `len()`); `trim_start`/`trim_end` are `&str` views past leading / before trailing ASCII whitespace (D71 slices, O(1), never a copy — `trim` still copies, #2225); `bytes()` is an `@[iter_of_self]` ephemeral `ByteIter` over the bytes. Delegated decision D105 in the log. The behavior test fails on the installed compiler with "unknown method 'rfind' for type 'str'".
…eIter.next adds to every program's prelude (41, 13)
Contributor
Author
|
Battery GREEN on stack top bfecc6f (seed-driven, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three
impl strmethods besideas_bytes, no intrinsics:rfind(findfrom the other end, -1 when absent),trim_start/trim_endas&strviews (D71 slices, never a copy;trimstill copies, #2225), andbytes()as an@[iter_of_self]ephemeralByteIter. Delegated decision D105 (D98) in the decision log.Fixes #2206. Draft until the stack's battery is green.