Get segments from table: checks "segments" and "fn" keys, returns default otherwise.
(t: &mlua::Table, default: u32)
| 30 | key: &str, |
| 31 | ) -> mlua::Result<bool> { |
| 32 | match t.get::<mlua::Value>(key)? { |
| 33 | LuaValue::Nil => Ok(false), |
| 34 | LuaValue::Boolean(b) => Ok(b), |
| 35 | v => Err(mlua::Error::RuntimeError(format!( |
| 36 | "{func}() parameter '{key}' must be a boolean, got {}", |
| 37 | v.type_name() |
| 38 | ))), |
| 39 | } |
no test coverage detected