Function clippy_utils::str_utils::count_match_end
source · Expand description
Returns the number of chars and bytes that match from the end
assert_eq!(count_match_end("hello_cat", "bye_cat"), StrCount::new(4, 4));
assert_eq!(count_match_end("if_item_thing", "enum_value"), StrCount::new(0, 0));
assert_eq!(count_match_end("Clippy", "Clippy"), StrCount::new(6, 6));
assert_eq!(count_match_end("MyT\u{f6}ff", "YourT\u{f6}ff"), StrCount::new(4, 5));