diff options
Diffstat (limited to 'src/docs/string_extend_chars.txt')
| -rw-r--r-- | src/docs/string_extend_chars.txt | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/docs/string_extend_chars.txt b/src/docs/string_extend_chars.txt deleted file mode 100644 index 619ea3e1186..00000000000 --- a/src/docs/string_extend_chars.txt +++ /dev/null @@ -1,23 +0,0 @@ -### What it does -Checks for the use of `.extend(s.chars())` where s is a -`&str` or `String`. - -### Why is this bad? -`.push_str(s)` is clearer - -### Example -``` -let abc = "abc"; -let def = String::from("def"); -let mut s = String::new(); -s.extend(abc.chars()); -s.extend(def.chars()); -``` -The correct use would be: -``` -let abc = "abc"; -let def = String::from("def"); -let mut s = String::new(); -s.push_str(abc); -s.push_str(&def); -``` \ No newline at end of file |
