From ad658885d421119dcc33d8d5df41a5740eb33454 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ga=C3=ABtan=20Cassiers?= Date: Mon, 22 Jun 2015 03:04:34 +0200 Subject: [PATCH] Comments for Rewrite --- src/rewrite.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rewrite.rs b/src/rewrite.rs index 4eed7421ff0..354e9b17061 100644 --- a/src/rewrite.rs +++ b/src/rewrite.rs @@ -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; } -- 2.44.0