Method
invoke
(&self, args: &[Value], _context: &Context)
Source from the content-addressed store, hash-verified
| 30 | } |
| 31 | |
| 32 | fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> { |
| 33 | debug!("{}", t!("functions.startsWith.invoked")); |
| 34 | if let (Some(string_to_search), Some(string_to_find)) = (args[0].as_str(), args[1].as_str()) { |
| 35 | Ok(Value::Bool(string_to_search.starts_with(string_to_find))) |
| 36 | } else { |
| 37 | Err(DscError::Parser(t!("functions.invalidArguments").to_string())) |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | #[cfg(test)] |
Callers
nothing calls this directly
Tested by
no test coverage detected