File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ pub mod rt {
135135 }
136136 }
137137
138+ impl ToSource for ast:: Arg {
139+ fn to_source ( & self ) -> String {
140+ pprust:: arg_to_str ( self )
141+ }
142+ }
143+
138144 impl < ' a > ToSource for & ' a str {
139145 fn to_source ( & self ) -> String {
140146 let lit = dummy_spanned ( ast:: LitStr (
@@ -264,6 +270,7 @@ pub mod rt {
264270 impl_to_tokens ! ( Generics )
265271 impl_to_tokens ! ( @ast:: Expr )
266272 impl_to_tokens ! ( ast:: Block )
273+ impl_to_tokens ! ( ast:: Arg )
267274 impl_to_tokens_self ! ( & ' a str )
268275 impl_to_tokens ! ( ( ) )
269276 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 {
242242 to_str ( |s| s. print_variant ( var) )
243243}
244244
245+ pub fn arg_to_str ( arg : & ast:: Arg ) -> String {
246+ to_str ( |s| s. print_arg ( arg) )
247+ }
248+
245249pub fn visibility_qualified ( vis : ast:: Visibility , s : & str ) -> String {
246250 match vis {
247251 ast:: Public => format ! ( "pub {}" , s) . to_string ( ) ,
You can’t perform that action at this time.
0 commit comments