chore: eliminate unwraps

This commit is contained in:
Shunsuke Shibayama 2024-03-23 09:52:52 +09:00
parent f5a21cac8a
commit d9e4dbe716
16 changed files with 65 additions and 26 deletions

View file

@ -233,6 +233,8 @@ impl Str {
/// assert_eq!(s.split_with(&[".", "::"]), vec!["a", "b", "c"]);
/// let s = Str::rc("ああ.いい::うう");
/// assert_eq!(s.split_with(&[".", "::"]), vec!["ああ", "いい", "うう"]);
/// let s = Str::rc("abc");
/// assert_eq!(s.split_with(&[".", "::"]), vec!["abc"]);
/// ```
pub fn split_with(&self, seps: &[&str]) -> Vec<&str> {
let mut result = vec![];