Skip to content

Lib: simplify str using lifetimed sub-strings? #5815

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

Closed
kud1ing opened this issue Apr 10, 2013 · 0 comments
Closed

Lib: simplify str using lifetimed sub-strings? #5815

kud1ing opened this issue Apr 10, 2013 · 0 comments

Comments

@kud1ing
Copy link

kud1ing commented Apr 10, 2013

My understanding is, that we don't need separate searching functions like all_between anymore, which operate on sub-strings via start/end indices.

I think the same functionality could be achieved by composing methods operating on lifetimed sub-strings (slices?).
E.g. something like all(substr(foo, 0, 5), foo()) instead of all_from.
If this is true, we could get rid of quite some functions and test code.

Candidates for removal:

  • all_between
  • any_between
  • count_chars
  • find_between
  • find_char_between
  • find_char_from
  • find_from
  • find_str_between
  • find_str_from
  • rfind_between
  • rfind_char_between
  • rfind_char_from
  • rfind_from

Some more userfriendly substr()-like functions should be added, like between() and from(), so that one could write all(between(...), ...) or find(from(...), ...).

@kud1ing kud1ing closed this as completed Jun 21, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 26, 2020
…r=flip1995

Redundant pattern bugfix

changelog: Fixes the bug reported rust-lang#5766
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant