]> git.lizzy.rs Git - rust.git/commitdiff
Add syntax::print::pprint::view_item_to_string
authorSimon Sapin <simon.sapin@exyr.org>
Thu, 23 Oct 2014 14:56:33 +0000 (23:56 +0900)
committerSimon Sapin <simon.sapin@exyr.org>
Thu, 23 Oct 2014 14:56:33 +0000 (23:56 +0900)
… similar to the existing `item_to_string`.

There may be more missing like this.

src/libsyntax/print/pprust.rs

index cdcbeedddb2393528371574f51826e6904f8ad74..5265c193fba7c8379a11c0c7d8ede3cacd4598af 100644 (file)
@@ -224,6 +224,10 @@ pub fn item_to_string(i: &ast::Item) -> String {
     $to_string(|s| s.print_item(i))
 }
 
+pub fn view_item_to_string(i: &ast::ViewItem) -> String {
+    $to_string(|s| s.print_view_item(i))
+}
+
 pub fn generics_to_string(generics: &ast::Generics) -> String {
     $to_string(|s| s.print_generics(generics))
 }