about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2014-10-23 23:56:33 +0900
committerSimon Sapin <simon.sapin@exyr.org>2014-10-23 23:56:33 +0900
commit941d90d97f8ab8658fca613c0ff79cde8ddf8fb5 (patch)
treeb54cfe8d1dd5fa85da1882f6e0721e9c0117efe6 /src/libsyntax
parent37f2db769f620edc1059762ffaf615466812c312 (diff)
downloadrust-941d90d97f8ab8658fca613c0ff79cde8ddf8fb5.tar.gz
rust-941d90d97f8ab8658fca613c0ff79cde8ddf8fb5.zip
Add syntax::print::pprint::view_item_to_string
… similar to the existing `item_to_string`.

There may be more missing like this.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index cdcbeedddb2..5265c193fba 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -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))
 }