loading...

re: Rust, Iterators, and Skill Regression VIEW POST

FULL DISCUSSION
 

Just my 50 cents, there's indeed a 3rd party library for things like that:

use itertools::Itertools;

fn has_double(s: &str) -> bool {
    s.chars().tuple_windows().any(|(a, b)| a == b)
}

Here's this code in playground

 

Good to know, thank you!

code of conduct - report abuse