ttvm 0.2.3

Runtime and compiler infrastructure API for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
pub fn split(string: String) -> Result<Vec<String>, mtk::ValueError> {
    if string.contains(" ") {
        let mut res: Vec<String> = Vec::new();

        for e in string.split_whitespace() {
            res.push(e.to_string());
        }

        Ok(res)
    } else {
        Err(mtk::ValueError::with_string(format!("nothing to split in '{}'", string)))
    } 
}