fn from()

in yaml_test_runner/src/step/transform_and_set.rs [50:81]


    fn from(t: &str) -> Self {
        let raw = t.to_string();
        let mut function = None;
        let mut exprs = Vec::new();
        let mut value = String::new();
        for ch in t.chars() {
            match ch {
                '#' => {
                    continue;
                }
                '(' => {
                    let name = format!("transform::{}", value.as_str().to_snake_case());
                    function = Some(name);
                    value = String::new();
                }
                ',' | ')' => {
                    let expr = value.trim();
                    exprs.push(Expr::new(expr));
                    value = String::new();
                }
                _ => {
                    value.push(ch);
                }
            }
        }

        Self {
            raw,
            function: function.unwrap(),
            exprs,
        }
    }