Implementing a “cautious” take_while using Peekable
问题 I'd like to use Peekable as the basis for a new cautious_take_while operation that acts like take_while from IteratorExt but without consuming the first failed item. (There's a side question of whether this is a good idea, and whether there are better ways to accomplish this goal in Rust -- I'd be happy for hints in that direction, but mostly I'm trying to understand where my code is breaking). The API I'm trying to enable is basically: let mut chars = "abcdefg.".chars().peekable(); let abc :