diff options
Diffstat (limited to 'src/tools/clippy/src/docs/char_lit_as_u8.txt')
-rw-r--r-- | src/tools/clippy/src/docs/char_lit_as_u8.txt | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/tools/clippy/src/docs/char_lit_as_u8.txt b/src/tools/clippy/src/docs/char_lit_as_u8.txt deleted file mode 100644 index 00d60b9a4..000000000 --- a/src/tools/clippy/src/docs/char_lit_as_u8.txt +++ /dev/null @@ -1,21 +0,0 @@ -### What it does -Checks for expressions where a character literal is cast -to `u8` and suggests using a byte literal instead. - -### Why is this bad? -In general, casting values to smaller types is -error-prone and should be avoided where possible. In the particular case of -converting a character literal to u8, it is easy to avoid by just using a -byte literal instead. As an added bonus, `b'a'` is even slightly shorter -than `'a' as u8`. - -### Example -``` -'x' as u8 -``` - -A better version, using the byte literal: - -``` -b'x' -```
\ No newline at end of file |