Skip to content

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

Closed
@kud1ing

Description

@kud1ing

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(...), ...).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions