mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
chore: eliminate unwrap
s
This commit is contained in:
parent
f5a21cac8a
commit
d9e4dbe716
16 changed files with 65 additions and 26 deletions
|
@ -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![];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue