Commit 675d2dab authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Merge branch 'correct-name-but-wrong-type' into 'master'

get_widget: Warn about potential type mismatch

See merge request !4
parents ae61b8a1 7405b46c
Pipeline #166407 passed with stages
in 6 minutes and 49 seconds
......@@ -30,11 +30,11 @@
#[macro_export]
macro_rules! get_widget {
($builder:expr, $wtype:ty, @$name:ident) => {{
let $name: $wtype = $builder.get_object(stringify!($name)).expect(&format!("Could not find widget \"{}\"", stringify!($name)));
let $name: $wtype = $builder.get_object(stringify!($name)).expect(&format!("Could not find widget \"{}\" of type \"{}\"", stringify!($name), stringify!($wtype)));
$name
}};
($builder:expr, $wtype:ty, $name:ident) => {
let $name: $wtype = $builder.get_object(stringify!($name)).expect(&format!("Could not find widget \"{}\"", stringify!($name)));
let $name: $wtype = $builder.get_object(stringify!($name)).expect(&format!("Could not find widget \"{}\" of type \"{}\"", stringify!($name), stringify!($wtype)));
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment