diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-03 12:48:13 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-03 12:48:13 +0000 |
commit | 05b3fe4255445a095bb30301dabfb7878e8c382e (patch) | |
tree | bf5314dd20eb90e5b68872f11a5e0e269bcc8fe4 /docs/dev/style.md | |
parent | 81a9ad3672d547b2f5d265766bbb6c79909fb2da (diff) | |
parent | f82ce500a9c72a4153850f15e17b60388e95b2af (diff) |
Merge #7537
7537: Fix spelling mistakes in docs/dev r=Veykril a=Veykril
Also adds a line for `crates/cfg` and `crates/stdx` to the architecture.
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'docs/dev/style.md')
-rw-r--r-- | docs/dev/style.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/dev/style.md b/docs/dev/style.md index e2f1b6996..0482bc190 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md | |||
@@ -159,7 +159,7 @@ Express function preconditions in types and force the caller to provide them (ra | |||
159 | 159 | ||
160 | ```rust | 160 | ```rust |
161 | // GOOD | 161 | // GOOD |
162 | fn frbonicate(walrus: Walrus) { | 162 | fn frobnicate(walrus: Walrus) { |
163 | ... | 163 | ... |
164 | } | 164 | } |
165 | 165 | ||
@@ -374,7 +374,7 @@ Avoid making a lot of code type parametric, *especially* on the boundaries betwe | |||
374 | 374 | ||
375 | ```rust | 375 | ```rust |
376 | // GOOD | 376 | // GOOD |
377 | fn frbonicate(f: impl FnMut()) { | 377 | fn frobnicate(f: impl FnMut()) { |
378 | frobnicate_impl(&mut f) | 378 | frobnicate_impl(&mut f) |
379 | } | 379 | } |
380 | fn frobnicate_impl(f: &mut dyn FnMut()) { | 380 | fn frobnicate_impl(f: &mut dyn FnMut()) { |
@@ -382,7 +382,7 @@ fn frobnicate_impl(f: &mut dyn FnMut()) { | |||
382 | } | 382 | } |
383 | 383 | ||
384 | // BAD | 384 | // BAD |
385 | fn frbonicate(f: impl FnMut()) { | 385 | fn frobnicate(f: impl FnMut()) { |
386 | // lots of code | 386 | // lots of code |
387 | } | 387 | } |
388 | ``` | 388 | ``` |
@@ -391,11 +391,11 @@ Avoid `AsRef` polymorphism, it pays back only for widely used libraries: | |||
391 | 391 | ||
392 | ```rust | 392 | ```rust |
393 | // GOOD | 393 | // GOOD |
394 | fn frbonicate(f: &Path) { | 394 | fn frobnicate(f: &Path) { |
395 | } | 395 | } |
396 | 396 | ||
397 | // BAD | 397 | // BAD |
398 | fn frbonicate(f: impl AsRef<Path>) { | 398 | fn frobnicate(f: impl AsRef<Path>) { |
399 | } | 399 | } |
400 | ``` | 400 | ``` |
401 | 401 | ||
@@ -705,7 +705,7 @@ fn foo() -> Option<Bar> { | |||
705 | } | 705 | } |
706 | ``` | 706 | ``` |
707 | 707 | ||
708 | **Rationale:** reduce congnitive stack usage. | 708 | **Rationale:** reduce cognitive stack usage. |
709 | 709 | ||
710 | ## Comparisons | 710 | ## Comparisons |
711 | 711 | ||