Compare commits
6 Commits
64c4a47c6f
...
88a7acd55d
| Author | SHA1 | Date | |
|---|---|---|---|
|
88a7acd55d
|
|||
|
3b7579878b
|
|||
|
46c32c3605
|
|||
|
d1e7988117
|
|||
|
93b0a526b1
|
|||
|
7bb5e65c1c
|
@@ -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::<Box<dyn Device>>() {
|
let ud = if ud.is::<Self>() {
|
||||||
ud
|
ud
|
||||||
} else {
|
} else {
|
||||||
ud.call_method::<_>("__box", ())?
|
ud.call_method::<_>("__box", ())?
|
||||||
@@ -36,7 +36,10 @@ 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::RuntimeError("Expected user data".into())),
|
_ => Err(mlua::Error::runtime(format!(
|
||||||
|
"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("FulfillmentConfig should have a definition");
|
output += &Config::generate_full().expect("Config should have a definition");
|
||||||
|
|
||||||
output
|
output
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user