Function clippy_utils::str_utils::count_match_start
source · Expand description
Returns the number of chars that match from the start
assert_eq!(count_match_start("hello_mouse", "hello_penguin"), StrCount::new(6, 6));
assert_eq!(count_match_start("hello_clippy", "bye_bugs"), StrCount::new(0, 0));
assert_eq!(count_match_start("hello_world", "hello_world"), StrCount::new(11, 11));
assert_eq!(count_match_start("T\u{f6}ffT\u{f6}ff", "T\u{f6}ff"), StrCount::new(4, 5));