Skip to content

Commit afd2cd9

Browse files
committed
Improve descriptions
1 parent d853b05 commit afd2cd9

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

clippy_lints/src/decimal_bit_mask.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ declare_clippy_lint! {
1414
///
1515
/// ### Why is this bad?
1616
/// Using decimal literals for bit masks can make the code less readable and obscure the intended bit pattern.
17-
/// Binary or hexadecimal or octal literals make the bit pattern more explicit and easier to understand at a glance.
17+
/// Binary, hexadecimal, or octal literals make the bit pattern more explicit and easier to understand at a glance.
1818
///
1919
/// ### Example
2020
/// ```rust,no_run
@@ -27,7 +27,7 @@ declare_clippy_lint! {
2727
#[clippy::version = "1.87.0"]
2828
pub DECIMAL_BIT_MASK,
2929
nursery,
30-
"use binary, hex or octal literals for bitwise operations"
30+
"use binary, hex, or octal literals for bitwise operations"
3131
}
3232

3333
declare_lint_pass!(DecimalBitMask => [DECIMAL_BIT_MASK]);
@@ -92,7 +92,7 @@ fn emit_lint(cx: &LateContext<'_>, span: Span) {
9292
span,
9393
"using decimal literal for bitwise operation",
9494
None,
95-
"use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability",
95+
"use binary (0b...), hex (0x...), or octal (0o...) notation for better readability",
9696
);
9797
}
9898

tests/ui/decimal_bit_mask.stderr

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: using decimal literal for bitwise operation
44
LL | x & 99;
55
| ^^
66
|
7-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
7+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
88
= note: `-D clippy::decimal-bit-mask` implied by `-D warnings`
99
= help: to override `-D warnings` add `#[allow(clippy::decimal_bit_mask)]`
1010

@@ -14,111 +14,111 @@ error: using decimal literal for bitwise operation
1414
LL | x | (/* comment */99);
1515
| ^^
1616
|
17-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
17+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
1818

1919
error: using decimal literal for bitwise operation
2020
--> tests/ui/decimal_bit_mask.rs:18:10
2121
|
2222
LL | x ^ (99);
2323
| ^^
2424
|
25-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
25+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
2626

2727
error: using decimal literal for bitwise operation
2828
--> tests/ui/decimal_bit_mask.rs:19:10
2929
|
3030
LL | x &= 99;
3131
| ^^
3232
|
33-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
33+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
3434

3535
error: using decimal literal for bitwise operation
3636
--> tests/ui/decimal_bit_mask.rs:20:10
3737
|
3838
LL | x |= 99;
3939
| ^^
4040
|
41-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
41+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
4242

4343
error: using decimal literal for bitwise operation
4444
--> tests/ui/decimal_bit_mask.rs:21:11
4545
|
4646
LL | x ^= (99);
4747
| ^^
4848
|
49-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
49+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
5050

5151
error: using decimal literal for bitwise operation
5252
--> tests/ui/decimal_bit_mask.rs:24:14
5353
|
5454
LL | 0b1010 & 99;
5555
| ^^
5656
|
57-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
57+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
5858

5959
error: using decimal literal for bitwise operation
6060
--> tests/ui/decimal_bit_mask.rs:25:15
6161
|
6262
LL | 0b1010 | (99);
6363
| ^^
6464
|
65-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
65+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
6666

6767
error: using decimal literal for bitwise operation
6868
--> tests/ui/decimal_bit_mask.rs:26:28
6969
|
7070
LL | 0b1010 ^ (/* comment */99);
7171
| ^^
7272
|
73-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
73+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
7474

7575
error: using decimal literal for bitwise operation
7676
--> tests/ui/decimal_bit_mask.rs:27:5
7777
|
7878
LL | 99 & 0b1010;
7979
| ^^
8080
|
81-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
81+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
8282

8383
error: using decimal literal for bitwise operation
8484
--> tests/ui/decimal_bit_mask.rs:28:6
8585
|
8686
LL | (99) | 0b1010;
8787
| ^^
8888
|
89-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
89+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
9090

9191
error: using decimal literal for bitwise operation
9292
--> tests/ui/decimal_bit_mask.rs:29:19
9393
|
9494
LL | (/* comment */99) ^ 0b1010;
9595
| ^^
9696
|
97-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
97+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
9898

9999
error: using decimal literal for bitwise operation
100100
--> tests/ui/decimal_bit_mask.rs:30:11
101101
|
102102
LL | 0xD | 99;
103103
| ^^
104104
|
105-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
105+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
106106

107107
error: using decimal literal for bitwise operation
108108
--> tests/ui/decimal_bit_mask.rs:31:5
109109
|
110110
LL | 88 & 99;
111111
| ^^
112112
|
113-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
113+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
114114

115115
error: using decimal literal for bitwise operation
116116
--> tests/ui/decimal_bit_mask.rs:31:10
117117
|
118118
LL | 88 & 99;
119119
| ^^
120120
|
121-
= help: use binary (0b...) or hex (0x...) or octal (0o...) notation for better readability
121+
= help: use binary (0b...), hex (0x...), or octal (0o...) notation for better readability
122122

123123
error: aborting due to 15 previous errors
124124

0 commit comments

Comments
 (0)