@@ -37,7 +37,7 @@ pub struct PyByteInner {
3737
3838impl TryFromObject for PyByteInner {
3939 fn try_from_object ( vm : & VirtualMachine , obj : PyObjectRef ) -> PyResult < Self > {
40- match_class ! ( match ( obj) {
40+ match_class ! ( match obj {
4141 i @ PyBytes => Ok ( PyByteInner {
4242 elements: i. get_value( ) . to_vec( )
4343 } ) ,
@@ -115,7 +115,7 @@ impl ByteInnerNewOptions {
115115 // Only one argument
116116 } else {
117117 let value = if let OptionalArg :: Present ( ival) = self . val_option {
118- match_class ! ( match ( ival. clone( ) ) {
118+ match_class ! ( match ival. clone( ) {
119119 i @ PyInt => {
120120 let size = objint:: get_value( & i. into_object( ) ) . to_usize( ) . unwrap( ) ;
121121 Ok ( vec![ 0 ; size] )
@@ -466,7 +466,7 @@ impl PyByteInner {
466466
467467 fn setindex ( & mut self , int : PyIntRef , object : PyObjectRef , vm : & VirtualMachine ) -> PyResult {
468468 if let Some ( idx) = self . elements . get_pos ( int. as_bigint ( ) . to_i32 ( ) . unwrap ( ) ) {
469- let result = match_class ! ( match ( object) {
469+ let result = match_class ! ( match object {
470470 i @ PyInt => {
471471 if let Some ( value) = i. as_bigint( ) . to_u8( ) {
472472 Ok ( value)
@@ -498,7 +498,7 @@ impl PyByteInner {
498498 . map ( |obj| u8:: try_from_object ( vm, obj) )
499499 . collect :: < PyResult < Vec < _ > > > ( ) ?)
500500 }
501- _ => match_class ! ( match ( object) {
501+ _ => match_class ! ( match object {
502502 i @ PyMemoryView => Ok ( i. get_obj_value( ) . unwrap( ) ) ,
503503 _ => Err ( vm. new_index_error(
504504 "can assign only bytes, buffers, or iterables of ints in range(0, 256)"
@@ -1149,7 +1149,7 @@ impl PyByteInner {
11491149}
11501150
11511151pub fn try_as_byte ( obj : & PyObjectRef ) -> Option < Vec < u8 > > {
1152- match_class ! ( match ( obj. clone( ) ) {
1152+ match_class ! ( match obj. clone( ) {
11531153 i @ PyBytes => Some ( i. get_value( ) . to_vec( ) ) ,
11541154 j @ PyByteArray => Some ( j. inner. borrow( ) . elements. to_vec( ) ) ,
11551155 _ => None ,
0 commit comments