about summary refs log tree commit diff
path: root/docs/dev
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-08-18 14:31:50 +0200
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-08-18 14:31:50 +0200
commit0d201638d9c7710795fa24765f7b761432cd5622 (patch)
tree275ea703aeaa5f9bfac22f85eb6e67092196fbfb /docs/dev
parente01cfe2b4508cded9ff9ceda993fa3540de6db83 (diff)
downloadrust-0d201638d9c7710795fa24765f7b761432cd5622.tar.gz
rust-0d201638d9c7710795fa24765f7b761432cd5622.zip
Add default names section
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/style.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/dev/style.md b/docs/dev/style.md
index 8effddcda55..2454087e89d 100644
--- a/docs/dev/style.md
+++ b/docs/dev/style.md
@@ -148,8 +148,13 @@ struct Foo {
 Use boring and long names for local variables ([yay code completion](https://github.com/rust-analyzer/rust-analyzer/pull/4162#discussion_r417130973)).
 The default name is a lowercased name of the type: `global_state: GlobalState`.
 Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`).
-The default name for "result of the function" local variable is `res`.
-The default name for "I don't really care about the name" variable is `it`.
+
+Default names:
+
+* `res` -- "result of the function" local variable
+* `it` -- I don't really care about the name
+* `n_foo` -- number of foos
+* `foo_idx` -- index of `foo`
 
 # Collection types