File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,16 @@ pub fn to_message_item(value: &Value, expected_type: Option<&DbusType>)
141141 ( Value :: String { val, .. } , Some ( DbusType :: Double ) ) =>
142142 Ok ( MessageItem :: Double ( try_convert ! ( f64 :: from_str( & val[ ..] ) ) ) ) ,
143143
144+ // Binary
145+ ( Value :: Binary { val, .. } , Some ( r#type @ DbusType :: Array ( content_type) ) )
146+ if matches ! ( * * content_type, DbusType :: Byte ) =>
147+ {
148+ // FIXME: this is likely pretty inefficient for a bunch of bytes
149+ let sig = Signature :: from ( r#type. stringify ( ) ) ;
150+ let items = val. iter ( ) . cloned ( ) . map ( MessageItem :: Byte ) . collect :: < Vec < _ > > ( ) ;
151+ Ok ( MessageItem :: Array ( MessageItemArray :: new ( items, sig) . unwrap ( ) ) )
152+ } ,
153+
144154 // List/array
145155 ( Value :: List { vals, .. } , Some ( r#type @ DbusType :: Array ( content_type) ) ) => {
146156 let sig = Signature :: from ( r#type. stringify ( ) ) ;
You can’t perform that action at this time.
0 commit comments