Compare commits
5 Commits
88a7acd55d
...
64c4a47c6f
| Author | SHA1 | Date | |
|---|---|---|---|
|
64c4a47c6f
|
|||
|
92a0bff8c4
|
|||
|
187220a49b
|
|||
|
4e2da2ecca
|
|||
|
65c7ed6349
|
@@ -27,7 +27,7 @@ impl mlua::FromLua for Box<dyn Device> {
|
|||||||
fn from_lua(value: mlua::Value, _lua: &mlua::Lua) -> mlua::Result<Self> {
|
fn from_lua(value: mlua::Value, _lua: &mlua::Lua) -> mlua::Result<Self> {
|
||||||
match value {
|
match value {
|
||||||
mlua::Value::UserData(ud) => {
|
mlua::Value::UserData(ud) => {
|
||||||
let ud = if ud.is::<Self>() {
|
let ud = if ud.is::<Box<dyn Device>>() {
|
||||||
ud
|
ud
|
||||||
} else {
|
} else {
|
||||||
ud.call_method::<_>("__box", ())?
|
ud.call_method::<_>("__box", ())?
|
||||||
@@ -36,10 +36,7 @@ impl mlua::FromLua for Box<dyn Device> {
|
|||||||
let b = ud.borrow::<Self>()?.clone();
|
let b = ud.borrow::<Self>()?.clone();
|
||||||
Ok(b)
|
Ok(b)
|
||||||
}
|
}
|
||||||
_ => Err(mlua::Error::runtime(format!(
|
_ => Err(mlua::Error::RuntimeError("Expected user data".into())),
|
||||||
"Expected user data, instead found: {}",
|
|
||||||
value.type_name()
|
|
||||||
))),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ fn config_definitions() -> String {
|
|||||||
output +=
|
output +=
|
||||||
&FulfillmentConfig::generate_full().expect("FulfillmentConfig should have a definition");
|
&FulfillmentConfig::generate_full().expect("FulfillmentConfig should have a definition");
|
||||||
output += "\n";
|
output += "\n";
|
||||||
output += &Config::generate_full().expect("Config should have a definition");
|
output += &Config::generate_full().expect("FulfillmentConfig should have a definition");
|
||||||
|
|
||||||
output
|
output
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user