1 #[macro_export] 2 macro_rules! has_required_feature { 3 ($object:ident, $feature:ident) => {{ 4 let has_feature = $object.$feature.is_some(); 5 if !has_feature { 6 println!( 7 "Missing {} feature {}", 8 stringify!($object), 9 stringify!($feature) 10 ); 11 } 12 has_feature 13 }}; 14 } 15