Skip to content

Commit bc4981f

Browse files
committed
Comments for Rewrite
1 parent 44338d8 commit bc4981f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rewrite.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// A generic trait to abstract the rewriting of an element (of the AST).
12+
1113
use syntax::codemap::CodeMap;
1214

1315
pub trait Rewrite {
16+
/// Rewrite self into offset and width.
17+
/// `offset` is the indentation of the first line. The next lines
18+
/// should begin with a least `offset` spaces (except backwards
19+
/// indentation). The first line should not begin with indentation.
20+
/// `width` is the maximum number of characters on the last line
21+
/// (excluding offset). The width of other lines is not limited by
22+
/// `width`.
1423
fn rewrite(&self, context: &RewriteContext, width: usize, offset: usize) -> Option<String>;
1524
}
1625

0 commit comments

Comments
 (0)