File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -642,7 +642,7 @@ mod tests {
642
642
arr. push ( "aaaaaaaaaaaaaaaaaaaa" . into ( ) ) ;
643
643
}
644
644
let val = AmqpType :: Array ( arr. into ( ) ) ;
645
- assert_eq ! ( val. encode( ) . constructor( ) , 0xe0 ) ;
645
+ assert_eq ! ( val. encode( ) . constructor( ) , 0xf0 ) ;
646
646
647
647
}
648
648
}
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ pub struct Binary(Vec<u8>);
7
7
8
8
impl Encode for Binary {
9
9
fn encode ( & self ) -> Encoded {
10
- todo ! ( )
10
+ match self . 0 . len ( ) {
11
+ x if x <= 255 => Encoded :: new ( 0xa0 , Some ( self . 0 . to_owned ( ) ) ) ,
12
+ _ => Encoded :: new ( 0xb0 , Some ( self . 0 . to_owned ( ) ) )
13
+ }
11
14
}
12
15
}
13
16
Original file line number Diff line number Diff line change 1
1
use crate :: types:: amqp_type:: { AmqpType , Constructor , Encode } ;
2
2
use indexmap:: IndexMap ;
3
+ use tracing:: info;
3
4
use std:: hash:: Hash ;
4
5
5
6
use super :: amqp_type:: Encoded ;
You can’t perform that action at this time.
0 commit comments