File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
modules/contributor/pages Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 5
5
=== Long versus abbreviated
6
6
7
7
We use unabbreviated identifier names to avoid ambiguity.
8
- Short (even single letter) variable names are allowed in lambdas (closures) and one-liners.
8
+ Short (even single letter) variable names are allowed in lambdas (closures), in one-liners, and when the context allows it.
9
+
10
+ [quote,Uncle Bob Martin, 'Source: https://twitter.com/unclebobmartin/status/360029878126514177[Twitter]']
11
+ The shorter the scope the shorter the variable names, and the longer the function [...] names. And vice versa.
12
+
9
13
The usage of well-known acronyms like CPU, TLS or OIDC are allowed.
10
14
11
15
[WARNING.code-rule,caption=Examples of incorrect code for this rule]
@@ -34,6 +38,8 @@ let parameter = Some("foo");
34
38
let buffer = &[];
35
39
36
40
fn function(elements: Vec<String>) {}
41
+
42
+ for i in 0..5 {}
37
43
----
38
44
39
45
====
You can’t perform that action at this time.
0 commit comments