@@ -2602,12 +2602,12 @@ impl CoroutineKind {
2602
2602
}
2603
2603
}
2604
2604
2605
- pub fn is_async ( self ) -> bool {
2606
- matches ! ( self , CoroutineKind :: Async { .. } )
2607
- }
2608
-
2609
- pub fn is_gen ( self ) -> bool {
2610
- matches ! ( self , CoroutineKind :: Gen { .. } )
2605
+ pub fn as_str ( self ) -> & ' static str {
2606
+ match self {
2607
+ CoroutineKind :: Async { .. } => "async" ,
2608
+ CoroutineKind :: Gen { .. } => "gen" ,
2609
+ CoroutineKind :: AsyncGen { .. } => "async gen" ,
2610
+ }
2611
2611
}
2612
2612
2613
2613
pub fn closure_id ( self ) -> NodeId {
@@ -3486,7 +3486,7 @@ impl From<ForeignItemKind> for ItemKind {
3486
3486
fn from ( foreign_item_kind : ForeignItemKind ) -> ItemKind {
3487
3487
match foreign_item_kind {
3488
3488
ForeignItemKind :: Static ( box static_foreign_item) => {
3489
- ItemKind :: Static ( Box :: new ( static_foreign_item. into ( ) ) )
3489
+ ItemKind :: Static ( Box :: new ( static_foreign_item) )
3490
3490
}
3491
3491
ForeignItemKind :: Fn ( fn_kind) => ItemKind :: Fn ( fn_kind) ,
3492
3492
ForeignItemKind :: TyAlias ( ty_alias_kind) => ItemKind :: TyAlias ( ty_alias_kind) ,
@@ -3500,9 +3500,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {
3500
3500
3501
3501
fn try_from ( item_kind : ItemKind ) -> Result < ForeignItemKind , ItemKind > {
3502
3502
Ok ( match item_kind {
3503
- ItemKind :: Static ( box static_item) => {
3504
- ForeignItemKind :: Static ( Box :: new ( static_item. into ( ) ) )
3505
- }
3503
+ ItemKind :: Static ( box static_item) => ForeignItemKind :: Static ( Box :: new ( static_item) ) ,
3506
3504
ItemKind :: Fn ( fn_kind) => ForeignItemKind :: Fn ( fn_kind) ,
3507
3505
ItemKind :: TyAlias ( ty_alias_kind) => ForeignItemKind :: TyAlias ( ty_alias_kind) ,
3508
3506
ItemKind :: MacCall ( a) => ForeignItemKind :: MacCall ( a) ,
0 commit comments