@@ -618,10 +618,12 @@ mod test {
618
618
let py_string = py. eval ( "u'x=\\ u00e4'" , None , None ) . unwrap ( ) ;
619
619
let data = py_string. cast_as :: < PyString > ( py) . unwrap ( ) . data ( py) ;
620
620
#[ cfg( feature = "python3-sys" ) ]
621
- if let PyStringData :: Latin1 ( s) = data {
622
- assert_eq ! ( [ b'x' , b'=' , 0xe4 ] , * s) ;
623
- } else {
624
- panic ! ( "Expected PyStringData::Latin1" ) ;
621
+ {
622
+ if let PyStringData :: Latin1 ( s) = data {
623
+ assert_eq ! ( [ b'x' , b'=' , 0xe4 ] , * s) ;
624
+ } else {
625
+ panic ! ( "Expected PyStringData::Latin1" ) ;
626
+ }
625
627
}
626
628
assert_eq ! ( "x=ä" , py_string. extract:: <String >( py) . unwrap( ) ) ;
627
629
}
@@ -633,10 +635,12 @@ mod test {
633
635
let py_string = py. eval ( "u'x=\\ ud800'" , None , None ) . unwrap ( ) ;
634
636
let data = py_string. cast_as :: < PyString > ( py) . unwrap ( ) . data ( py) ;
635
637
#[ cfg( feature = "python3-sys" ) ]
636
- if let PyStringData :: Utf16 ( s) = data {
637
- assert_eq ! ( [ 'x' as u16 , '=' as u16 , 0xd800 ] , * s) ;
638
- } else {
639
- panic ! ( "Expected PyStringData::Utf16" ) ;
638
+ {
639
+ if let PyStringData :: Utf16 ( s) = data {
640
+ assert_eq ! ( [ 'x' as u16 , '=' as u16 , 0xd800 ] , * s) ;
641
+ } else {
642
+ panic ! ( "Expected PyStringData::Utf16" ) ;
643
+ }
640
644
}
641
645
assert ! ( py_string. extract:: <String >( py) . is_err( ) ) ;
642
646
}
0 commit comments