pub fn split_once(text: &str, pattern: &str) -> Result<(String, String)> {
    let splitter: Vec<&str> = text.splitn(2, pattern).collect();
    if splitter.len() != 2 {
        return Err(anyhow!("Invalid split of '{}' on '{}'.", text, pattern));
    }
    let first = splitter[0];
    let second = splitter[1];
    Ok((first.to_string(), second.to_string()))
}
/// A utility function for splitting a string at a single point and converting it into a tuple.
/// Returns an Err(anyhow) if it can't do the split.
A utility function for splitting a string at a single point and converting it into a tuple.
Returns an Err(anyhow) if it can't do the split.
A utility function for splitting a string at a single point and converting it into a tuple . Returns an Err ( anyhow ) if it can ' t do the split .
pub fn split_once(text: &str, pattern: &str) -> Result<(String, String)> {
    let splitter: Vec<&str> = text.splitn(2, pattern).collect();
    if splitter.len() != 2 {
        return Err(anyhow!("Invalid split of '{}' on '{}'.", text, pattern));
    }
    let first = splitter[0];
    let second = splitter[1];
    Ok((first.to_string(), second.to_string()))
}
pub fn split_once ( text : & str , pattern : & str ) -> Result < ( String , String ) > { let splitter : Vec < & str > = text . splitn ( 2 , pattern ) . collect ( ) ; if splitter . len ( ) != 2 { return Err ( anyhow ! ( " " text pattern ) ) ; } let first = splitter [ 0 ] ; let second = splitter [ 1 ] ; Ok ( ( first . to_string ( ) , second . to_string ( ) ) ) }
A utility function for splitting a string at a single point and converting it into a tuple.
A utility function for splitting a string at a single point and converting it into a tuple .
text
&str
pattern
&str
text
&str
pattern
&str