summaryrefslogtreecommitdiff
path: root/src/codegen/helpers.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-07-10 15:16:14 -0700
committerGitHub <noreply@github.com>2017-07-10 15:16:14 -0700
commita00db0446f7296891c2c78bd19cdbff825e1a18f (patch)
tree3ec07ef83d22ceb36d87c626cf64c324949172a7 /src/codegen/helpers.rs
parent02afb5b4b1b1e5d49743d6529bce6871918a49cb (diff)
parent96304f90a4ce8c93f6ae39ee249fd72ab34bcfa4 (diff)
Auto merge of #799 - emilio:comment-indent, r=fitzgen
codegen: Make comments indentation-aware. This commit moves comment processing to a central place (well, two, because of field docs, but that's fine). Also, it makes comments indentation aware, so multiline comments don't appear garbled. Finally, it also fixes an out-of-bounds panic when processing an empty multiline comment.
Diffstat (limited to 'src/codegen/helpers.rs')
-rw-r--r--src/codegen/helpers.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs
index eb843a65..4a64f799 100644
--- a/src/codegen/helpers.rs
+++ b/src/codegen/helpers.rs
@@ -30,8 +30,8 @@ pub mod attributes {
aster::AstBuilder::new().attr().word("inline")
}
- pub fn doc(comment: &str) -> ast::Attribute {
- aster::AstBuilder::new().attr().doc(comment)
+ pub fn doc(comment: String) -> ast::Attribute {
+ aster::AstBuilder::new().attr().doc(&*comment)
}
pub fn link_name(name: &str) -> ast::Attribute {