File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ pub mod rt {
135
135
}
136
136
}
137
137
138
+ impl ToSource for ast:: Arg {
139
+ fn to_source ( & self ) -> String {
140
+ pprust:: arg_to_str ( self )
141
+ }
142
+ }
143
+
138
144
impl < ' a > ToSource for & ' a str {
139
145
fn to_source ( & self ) -> String {
140
146
let lit = dummy_spanned ( ast:: LitStr (
@@ -264,6 +270,7 @@ pub mod rt {
264
270
impl_to_tokens ! ( Generics )
265
271
impl_to_tokens ! ( @ast:: Expr )
266
272
impl_to_tokens ! ( ast:: Block )
273
+ impl_to_tokens ! ( ast:: Arg )
267
274
impl_to_tokens_self ! ( & ' a str )
268
275
impl_to_tokens ! ( ( ) )
269
276
impl_to_tokens ! ( char )
Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ pub fn variant_to_str(var: &ast::Variant) -> String {
242
242
to_str ( |s| s. print_variant ( var) )
243
243
}
244
244
245
+ pub fn arg_to_str ( arg : & ast:: Arg ) -> String {
246
+ to_str ( |s| s. print_arg ( arg) )
247
+ }
248
+
245
249
pub fn visibility_qualified ( vis : ast:: Visibility , s : & str ) -> String {
246
250
match vis {
247
251
ast:: Public => format ! ( "pub {}" , s) . to_string ( ) ,
You can’t perform that action at this time.
0 commit comments