]> git.lizzy.rs Git - rust.git/commitdiff
improved string_add/string_add_assign messages, Allow-by-default string_add_assign
authorllogiq <bogusandre@gmail.com>
Thu, 13 Aug 2015 09:35:30 +0000 (11:35 +0200)
committerllogiq <bogusandre@gmail.com>
Thu, 13 Aug 2015 09:35:30 +0000 (11:35 +0200)
README.md
src/strings.rs

index 4644bac94cde1c78a5d319dcc5b5c1fdca9409c3..d2e5049f8e1745de9fc029241c07b01981ac90a6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ Lints included in this crate:
  - `inline_always`: Warns on `#[inline(always)]`, because in most cases it is a bad idea
  - `collapsible_if`: Warns on cases where two nested `if`-expressions can be collapsed into one, e.g. `if x { if y { foo() } }` can be written as `if x && y { foo() }`
  - `zero_width_space`: Warns on encountering a unicode zero-width space
- - `string_add_assign`: Warns on `x = x + ..` where `x` is a `String` and suggests using `push_str(..)` instead.
+ - `string_add_assign`: Warns on `x = x + ..` where `x` is a `String` and suggests using `push_str(..)` instead. Allowed by default.
  - `string_add`: Matches `x + ..` where `x` is a `String` and where `string_add_assign` doesn't warn. Allowed by default.
  - `needless_return`: Warns on using `return expr;` when a simple `expr` would suffice.
  - `let_and_return`: Warns on doing `let x = expr; x` at the end of a function.
index 33db980c0651ca93d626e35b185718962acca837..226b851e9914121694752f131afd7407b4e85370 100644 (file)
 
 declare_lint! {
     pub STRING_ADD_ASSIGN,
-    Warn,
-    "Warn on `x = x + ..` where x is a `String`"
+    Allow,
+    "expressions of the form `x = x + ..` where x is a `String`"
 }
 
 declare_lint! {
     pub STRING_ADD,
     Allow,
-    "Warn on `x + ..` where x is a `String`"
+    "expressions of the form `x + ..` where x is a `String` \
+     unless `string_add_assign` matches"
 }
 
 #[derive(Copy, Clone)]