servo_bluetooth/
macros.rs1#[cfg(feature = "bluetooth-test")]
6macro_rules! get_inner_and_call_test_func {
7 ($enum_value: expr, $enum_type: ident, $function_name: ident, $value: expr) => {
8 match $enum_value {
9 &$enum_type::Mock(ref fake) => fake.$function_name($value),
10 #[cfg(feature = "native-bluetooth")]
11 _ => Err(Box::from(
12 "Error! Test functions are not supported on real devices!",
13 )),
14 }
15 };
16
17 ($enum_value: expr, $enum_type: ident, $function_name: ident) => {
18 match $enum_value {
19 &$enum_type::Mock(ref fake) => fake.$function_name(),
20 #[cfg(feature = "native-bluetooth")]
21 _ => Err(Box::from(
22 "Error! Test functions are not supported on real devices!",
23 )),
24 }
25 };
26}
27
28#[cfg(feature = "bluetooth-test")]
29pub(crate) use get_inner_and_call_test_func;