Thank you! We'll be in touch ASAP.
Something went wrong, please try again or contact us directly at contact@dagshub.com
pub fn split_first<'a>(line: &'a str) -> Option<(&'a str, &'a str)> { match line.find('\t') { Some(i) => Some((&line[0..i], &line[(i+1)..])), None => None } } #[test] fn split_empty() { assert_eq!(split_first(""), None) } #[test] fn split_tab() { assert_eq!(split_first("foo\tbar"), Some(("foo", "bar"))) } #[test] fn split_end() { assert_eq!(split_first("foo\t"), Some(("foo", ""))) } #[test] fn split_2() { assert_eq!(split_first("foo\tbar\tblatz"), Some(("foo", "bar\tblatz"))) }
Press p or to see the previous file or, n or to see the next file