File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -802,7 +802,7 @@ impl<T: sealed::Context> Features<T> {
802
802
} ;
803
803
804
804
if byte & ( REQUIRED_FEATURES & unknown_features) != 0 {
805
- for bit in 0 ..8 {
805
+ for bit in ( 0 ..8 ) . step_by ( 2 ) {
806
806
if byte >> bit & 1 == 1 {
807
807
unknown_bits. push ( i * 8 + bit) ;
808
808
}
@@ -1070,6 +1070,13 @@ mod tests {
1070
1070
assert ! ( !features. requires_unknown_bits( ) ) ;
1071
1071
assert ! ( features. supports_unknown_bits( ) ) ;
1072
1072
assert_eq ! ( features. required_unknown_bits_from( & ChannelFeatures :: empty( ) ) , vec![ ] ) ;
1073
+
1074
+ let mut features = ChannelFeatures :: empty ( ) ;
1075
+ features. set_unknown_feature_optional ( ) ;
1076
+ features. set_custom_bit ( 123456786 ) . unwrap ( ) ;
1077
+ assert ! ( features. requires_unknown_bits( ) ) ;
1078
+ assert ! ( features. supports_unknown_bits( ) ) ;
1079
+ assert_eq ! ( features. required_unknown_bits_from( & ChannelFeatures :: empty( ) ) , vec![ 123456786 ] ) ;
1073
1080
}
1074
1081
1075
1082
#[ test]
You can’t perform that action at this time.
0 commit comments