]> git.lizzy.rs Git - rust.git/commitdiff
lint messages: remove trailing period
authorGeorg Brandl <georg@python.org>
Thu, 13 Aug 2015 06:15:42 +0000 (08:15 +0200)
committerGeorg Brandl <georg@python.org>
Thu, 13 Aug 2015 06:15:42 +0000 (08:15 +0200)
Since lint messages often are suffixed by ", #[warn(xxx)] on by default"
this trailing period produces an ugly clash with the comma.

src/approx_const.rs
src/eta_reduction.rs
src/identity_op.rs
src/len_zero.rs
src/methods.rs
src/misc.rs
src/mut_mut.rs
src/ptr_arg.rs
src/strings.rs
src/types.rs
src/unicode.rs

index 594348bf93faf52b4e24c67859ff9aae84696d91..377c7e66ebd6a9c572b1c9739c5615c9459793fc 100644 (file)
@@ -53,7 +53,7 @@ fn check_known_consts(cx: &Context, span: Span, str: &str, module: &str) {
         for &(constant, name) in KNOWN_CONSTS {
             if within_epsilon(constant, value) {
                 span_lint(cx, APPROX_CONSTANT, span, &format!(
-                    "approximate value of `{}::{}` found. Consider using it directly.", module, &name));
+                    "approximate value of `{}::{}` found. Consider using it directly", module, &name));
             }
         }
     }
index 00c5a5239819d88df574e2d64f93b61a02decdd7..eda38419d4dc7758c831959f90ff8b93d870c38c 100644 (file)
@@ -51,7 +51,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
                         }
                     }
                     span_lint(cx, REDUNDANT_CLOSURE, expr.span,
-                                 &format!("redundant closure found. Consider using `{}` in its place.",
+                                 &format!("redundant closure found. Consider using `{}` in its place",
                                           expr_to_string(caller))[..])
                 }
             }
index e043ac63026b71a9559b6bfac0a5dfe92044db20..8c6940e3df4909e86350331e9f1bad0612ace715 100644 (file)
@@ -49,7 +49,7 @@ fn check_expr(&mut self, cx: &Context, e: &Expr) {
 fn check(cx: &Context, e: &Expr, m: i8, span: Span, arg: Span) {
     if have_lit(cx, e, m) {
         span_lint(cx, IDENTITY_OP, span, &format!(
-            "the operation is ineffective. Consider reducing it to `{}`.",
+            "the operation is ineffective. Consider reducing it to `{}`",
            snippet(cx, arg, "..")));
     }
 }
index 298522ed24cea51d558d7fa8c9b7cdaf61169819..da230c1d28a7c5dd7bbccf9e1a05438dbbca169e 100644 (file)
@@ -59,7 +59,7 @@ fn is_named_self(item: &TraitItem, name: &str) -> bool {
             if is_named_self(i, "len") {
                 span_lint(cx, LEN_WITHOUT_IS_EMPTY, i.span,
                           &format!("trait `{}` has a `.len(_: &Self)` method, but no \
-                                    `.is_empty(_: &Self)` method. Consider adding one.",
+                                    `.is_empty(_: &Self)` method. Consider adding one",
                                    item.ident.name));
             }
         };
@@ -79,7 +79,7 @@ fn is_named_self(item: &ImplItem, name: &str) -> bool {
                 span_lint(cx, LEN_WITHOUT_IS_EMPTY,
                           Span{ lo: s.lo, hi: s.lo, expn_id: s.expn_id },
                           &format!("item `{}` has a `.len(_: &Self)` method, but no \
-                                    `.is_empty(_: &Self)` method. Consider adding one.",
+                                    `.is_empty(_: &Self)` method. Consider adding one",
                                    item.ident.name));
                 return;
             }
index a5b12e52bdf5be5723eb492b48149a26d4c6ab0f..403845771a9ce69feacc725fab53270546b31266 100644 (file)
@@ -30,12 +30,12 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
                         span_lint(cx, OPTION_UNWRAP_USED, expr.span,
                                   "used unwrap() on an Option value. If you don't want \
                                    to handle the None case gracefully, consider using
-                                   expect() to provide a better panic message.");
+                                   expect() to provide a better panic message");
                     }
                     else if match_def_path(cx, did.did, &["core", "result", "Result"]) {
                         span_lint(cx, RESULT_UNWRAP_USED, expr.span,
                                   "used unwrap() on a Result value. Graceful handling \
-                                   of Err values is preferred.");
+                                   of Err values is preferred");
                     }
                 }
             }
index d5e1efe2cc3a7fd80a55eb246253257990f43527..82754820f8babe5ab9ea589341cd508ae53cdf19 100644 (file)
@@ -129,7 +129,8 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
             let op = cmp.node;
             if (op == BiEq || op == BiNe) && (is_float(cx, left) || is_float(cx, right)) {
                 span_lint(cx, FLOAT_CMP, expr.span, &format!(
-                    "{}-comparison of f32 or f64 detected. Consider changing this to `abs({} - {}) < epsilon` for some suitable value of epsilon.",
+                    "{}-comparison of f32 or f64 detected. Consider changing this to \
+                     `abs({} - {}) < epsilon` for some suitable value of epsilon",
                     binop_to_string(op), snippet(cx, left.span, ".."),
                     snippet(cx, right.span, "..")));
             }
@@ -160,7 +161,8 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
         if let ExprBinary(Spanned { node: op, ..}, ref left, ref right) = expr.node {
             if is_bit_op(op) && (is_arith_expr(left) || is_arith_expr(right)) {
                 span_lint(cx, PRECEDENCE, expr.span,
-                    "operator precedence can trip the unwary. Consider adding parenthesis to the subexpression.");
+                    "operator precedence can trip the unwary. Consider adding parenthesis \
+                     to the subexpression");
             }
         }
     }
@@ -216,7 +218,7 @@ fn check_to_owned(cx: &Context, expr: &Expr, other_span: Span) {
                 name == "to_owned" && is_str_arg(cx, args) {
                     span_lint(cx, CMP_OWNED, expr.span, &format!(
                         "this creates an owned instance just for comparison. \
-                         Consider using `{}.as_slice()` to compare without allocation.",
+                         Consider using `{}.as_slice()` to compare without allocation",
                         snippet(cx, other_span, "..")))
                 }
         },
@@ -226,7 +228,7 @@ fn check_to_owned(cx: &Context, expr: &Expr, other_span: Span) {
                     match_path(path, &["String", "from"]) {
                         span_lint(cx, CMP_OWNED, expr.span, &format!(
                             "this creates an owned instance just for comparison. \
-                             Consider using `{}.as_slice()` to compare without allocation.",
+                             Consider using `{}.as_slice()` to compare without allocation",
                             snippet(cx, other_span, "..")))
                     }
             }
index 469a14a94520dc210263b8491164a268b36c77a4..a2055bb655f1ddbcdf59347e1b4267844a94c639 100644 (file)
@@ -46,7 +46,7 @@ fn unwrap_addr(expr : &Expr) -> Option<&Expr> {
                 cx.tcx.expr_ty(e).sty {
                     span_lint(cx, MUT_MUT, expr.span,
                               "this expression mutably borrows a mutable reference. \
-                               Consider reborrowing.")
+                               Consider reborrowing")
                 }
         })
     })
index ed37c1120405ed23ba1d8a39746c475a8e0f8976..3868854c7a108ff7f0bd27e4a0217edf4d50fb3b 100644 (file)
@@ -61,9 +61,9 @@ fn check_ptr_subtype(cx: &Context, span: Span, ty: &Ty) {
         &["String"]).map_or((), |_| {
             span_lint(cx, PTR_ARG, span,
                       "writing `&String` instead of `&str` involves a new object \
-                       where a slice will do. Consider changing the type to `&str`.")
+                       where a slice will do. Consider changing the type to `&str`")
         }), |_| span_lint(cx, PTR_ARG, span,
                           "writing `&Vec<_>` instead of \
                            `&[_]` involves one more reference and cannot be used with \
-                           non-Vec-based slices. Consider changing the type to `&[...]`."))
+                           non-Vec-based slices. Consider changing the type to `&[...]`"))
 }
index 97016f362681e41d61491c4768475b7e3d4f66a3..afc444dd67f7f9b9aa760281a499bcc954716dae 100644 (file)
@@ -30,7 +30,7 @@ fn check_expr(&mut self, cx: &Context, e: &Expr) {
             if is_string(cx, target) && is_add(src, target) {
                 span_lint(cx, STRING_ADD_ASSIGN, e.span,
                     "you assign the result of adding something to this string. \
-                    Consider using `String::push_str()` instead.")
+                    Consider using `String::push_str()` instead")
             }
         }
     }
index 4980046e01b6d0c31cd1358d381d4e26b1e4a48b..c22d088ce5b88f6ff6657060cff512fcdfe7265f 100644 (file)
@@ -90,7 +90,7 @@ fn check_let_unit(cx: &Context, decl: &Decl, info: Option<&ExpnInfo>) {
         let bindtype = &cx.tcx.pat_ty(&*local.pat).sty;
         if *bindtype == ty::TyTuple(vec![]) {
             span_lint(cx, LET_UNIT_VALUE, decl.span, &format!(
-                "this let-binding has unit value. Consider omitting `let {} =`.",
+                "this let-binding has unit value. Consider omitting `let {} =`",
                 snippet(cx, local.pat.span, "..")));
         }
     }
index ca6abaf01b4ba1c27d2cafe0db2db9b22095a53a..161e90d0f64e7fccba4dc7b646665e5c7f8b87da 100644 (file)
@@ -27,11 +27,11 @@ fn check_str(cx: &Context, string: &str, span: Span) {
     for (i, c) in string.char_indices() {
         if c == '\u{200B}' {
             str_pos_lint(cx, ZERO_WIDTH_SPACE, span, i,
-                         "zero-width space detected. Consider using `\\u{200B}`.");
+                         "zero-width space detected. Consider using `\\u{200B}`");
         }
         if c as u32 > 0x7F {
             str_pos_lint(cx, NON_ASCII_LITERAL, span, i, &format!(
-                "literal non-ASCII character detected. Consider using `\\u{{{:X}}}`.", c as u32));
+                "literal non-ASCII character detected. Consider using `\\u{{{:X}}}`", c as u32));
         }
     }
 }