]> git.lizzy.rs Git - rust.git/commitdiff
Comments for Rewrite
authorGaëtan Cassiers <gaetan.cassiers@gmail.com>
Mon, 22 Jun 2015 01:04:34 +0000 (03:04 +0200)
committerGaëtan Cassiers <gaetan.cassiers@gmail.com>
Tue, 23 Jun 2015 00:15:46 +0000 (02:15 +0200)
src/rewrite.rs

index 4eed7421ff0a927d677523a93284e310f433a79c..354e9b17061de3bf52ba122ab9dd772410db5cf5 100644 (file)
@@ -8,9 +8,18 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// A generic trait to abstract the rewriting of an element (of the AST).
+
 use syntax::codemap::CodeMap;
 
 pub trait Rewrite {
+    /// Rewrite self into offset and width.
+    /// `offset` is the indentation of the first line. The next lines
+    /// should begin with a least `offset` spaces (except backwards
+    /// indentation). The first line should not begin with indentation.
+    /// `width` is the maximum number of characters on the last line
+    /// (excluding offset). The width of other lines is not limited by
+    /// `width`.
     fn rewrite(&self, context: &RewriteContext, width: usize, offset: usize) -> Option<String>;
 }