(&self, args: &[Value], _context: &Context)
| 29 | } |
| 30 | |
| 31 | fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> { |
| 32 | // first argument is the type and must contain only 1 slash |
| 33 | let resource_type = &args[0].as_str().unwrap(); |
| 34 | let slash_count = resource_type.chars().filter(|c| *c == '/').count(); |
| 35 | if slash_count != 1 { |
| 36 | return Err(DscError::Function("resourceId".to_string(), t!("functions.resourceId.incorrectTypeFormat").to_string())); |
| 37 | } |
| 38 | |
| 39 | let resource_name = &args[1].as_str().unwrap(); |
| 40 | let result = resource_id(resource_type, resource_name); |
| 41 | Ok(Value::String(result)) |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | #[cfg(test)] |
nothing calls this directly
no test coverage detected