Wrap comments when formatting with rustfmt

This commit is contained in:
David Tolnay 2018-08-14 22:43:00 -07:00
parent 278f9e36e8
commit 0ccb6d1786
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 7 additions and 5 deletions

1
rustfmt.toml Normal file
View File

@ -0,0 +1 @@
wrap_comments = true

View File

@ -18,7 +18,8 @@
//! methods).
//! 3. Serialize the `syn` expression back into a string, and re-parse it with
//! `libsyntax`.
//! 4. Respan all of the expressions, replacing the spans with the default spans.
//! 4. Respan all of the expressions, replacing the spans with the default
//! spans.
//! 5. Compare the expressions with one another, if they are not equal fail.
#[macro_use]
@ -204,8 +205,8 @@ fn libsyntax_parse_and_rewrite(input: &str) -> Option<P<ast::Expr>> {
}
/// Wrap every expression which is not already wrapped in parens with parens, to
/// reveal the precidence of the parsed expressions, and produce a stringified form
/// of the resulting expression.
/// reveal the precidence of the parsed expressions, and produce a stringified
/// form of the resulting expression.
///
/// This method operates on libsyntax objects.
fn libsyntax_brackets(libsyntax_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
@ -292,8 +293,8 @@ fn libsyntax_brackets(libsyntax_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
}
/// Wrap every expression which is not already wrapped in parens with parens, to
/// reveal the precedence of the parsed expressions, and produce a stringified form
/// of the resulting expression.
/// reveal the precedence of the parsed expressions, and produce a stringified
/// form of the resulting expression.
fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr {
use syn::fold::*;
use syn::*;