File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
#![ no_std]
4
4
5
- #[ deny( missing_docs) ]
6
- #[ deny( clippy:: all) ]
5
+ #![ deny( missing_docs) ]
6
+ #![ deny( clippy:: all) ]
7
+
7
8
use bit_field:: BitField ;
8
9
9
10
/// Possible errors returned by the API.
@@ -119,18 +120,18 @@ pub fn decode(input: &[u16], output: &mut [u8]) -> Result<usize> {
119
120
return Err ( Error :: BufferOverflow ) ;
120
121
}
121
122
122
- output[ i] = 0b11000000 + ch. get_bits ( 6 ..11 ) as u8 ;
123
- output[ i + 1 ] = 0b10000000 + ch. get_bits ( 0 ..6 ) as u8 ;
123
+ output[ i] = 0b1100_0000 + ch. get_bits ( 6 ..11 ) as u8 ;
124
+ output[ i + 1 ] = 0b1000_0000 + ch. get_bits ( 0 ..6 ) as u8 ;
124
125
i += 2 ;
125
126
} else {
126
127
// Can be encoded as three bytes
127
128
if ( i + 2 ) >= buffer_size {
128
129
return Err ( Error :: BufferOverflow ) ;
129
130
}
130
131
131
- output[ i] = 0b11100000 + ch. get_bits ( 12 ..16 ) as u8 ;
132
- output[ i + 1 ] = 0b10000000 + ch. get_bits ( 6 ..12 ) as u8 ;
133
- output[ i + 2 ] = 0b10000000 + ch. get_bits ( 0 ..6 ) as u8 ;
132
+ output[ i] = 0b1110_0000 + ch. get_bits ( 12 ..16 ) as u8 ;
133
+ output[ i + 1 ] = 0b1000_0000 + ch. get_bits ( 6 ..12 ) as u8 ;
134
+ output[ i + 2 ] = 0b1000_0000 + ch. get_bits ( 0 ..6 ) as u8 ;
134
135
i += 3 ;
135
136
}
136
137
}
You can’t perform that action at this time.
0 commit comments