File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -234,11 +234,11 @@ fn check_type_ref(cx: &mut Check, ty: &Ref) {
234
234
}
235
235
236
236
fn check_type_slice_ref ( cx : & mut Check , ty : & SliceRef ) {
237
- let supported = match & ty. inner {
238
- Type :: Str ( _ ) | Type :: SliceRef ( _ ) => false ,
239
- Type :: Ident ( ident) => ! is_unsized ( cx , & ty . inner ) || cx. types . rust . contains ( & ident. rust ) ,
240
- element => ! is_unsized ( cx , element ) ,
241
- } ;
237
+ let supported = ! is_unsized ( cx , & ty. inner )
238
+ || match & ty . inner {
239
+ Type :: Ident ( ident) => cx. types . rust . contains ( & ident. rust ) ,
240
+ _ => false ,
241
+ } ;
242
242
243
243
if !supported {
244
244
let mutable = if ty. mutable { "mut " } else { "" } ;
@@ -253,10 +253,7 @@ fn check_type_slice_ref(cx: &mut Check, ty: &SliceRef) {
253
253
}
254
254
255
255
fn check_type_array ( cx : & mut Check , ty : & Array ) {
256
- let supported = match & ty. inner {
257
- Type :: Str ( _) | Type :: SliceRef ( _) => false ,
258
- element => !is_unsized ( cx, element) ,
259
- } ;
256
+ let supported = !is_unsized ( cx, & ty. inner ) ;
260
257
261
258
if !supported {
262
259
cx. error ( ty, "unsupported array element type" ) ;
You can’t perform that action at this time.
0 commit comments