Am I missing something?
std::str::Chars::as_str gives you an
&str slice of the remainder of the string you're iterating over, which is useful. But many of the iterator methods, e.g.,
skip_while and especially
peekable, return an interator adaptor, e.g.,
Peekable<Chars>, that does NOT support
Is there a way to get
as_str back in these cases? I've been looking and I've not found one. In particular, I want to be able to use
Note: I'm not looking for complex work-arounds here; I can look at character lengths and wrangle slice indices if I have to. What I want to know is whether or not there's a simple efficient solution in the existing API that I'm missing.