Slightly better name

This commit is contained in:
Aleksey Kladov 2020-06-23 21:29:50 +02:00
parent 9caf810129
commit ff687453a8
4 changed files with 9 additions and 9 deletions

View file

@ -124,7 +124,7 @@ pub fn replace(buf: &mut String, from: char, to: &str) {
*buf = buf.replace(from, to)
}
pub fn split1(haystack: &str, delim: char) -> Option<(&str, &str)> {
pub fn split_delim(haystack: &str, delim: char) -> Option<(&str, &str)> {
let idx = haystack.find(delim)?;
Some((&haystack[..idx], &haystack[idx + delim.len_utf8()..]))
}