Skip to content

Commit 3b8d847

Browse files
committed
idiomatic: revert non-significant changes
1 parent 34a4f7b commit 3b8d847

21 files changed

Lines changed: 45 additions & 45 deletions

File tree

src/idiomatic/foundations-api-design/meaningful-doc-comments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn connect() -> Result<(), Error> {...}
1717

1818
<details>
1919

20-
- Doc comments are the primary form of documentation developers engage with.
20+
- Doc comments are the most common form of documentation developers engage with.
2121

2222
- Good doc comments provide information that the code, names, and types cannot,
2323
without restating the obvious information.

src/idiomatic/foundations-api-design/meaningful-doc-comments/avoid-redundancy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ minutes: 15
44

55
# Avoiding Redundancy
66

7-
Names and type signatures communicate significant information, don't repeat it
8-
in comments!
7+
Names and type signatures communicate a lot of information, don't repeat it in
8+
comments!
99

1010
```rust,compile_fail
1111
// Repeats name/type information. Can omit!

src/idiomatic/foundations-api-design/meaningful-doc-comments/exercise.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ fn sort_quickly<T: Ord>(to_sort: &mut [T]) { ... }
3939

4040
- Ask the class: Now we have more detail, how should we comment this function?
4141

42-
The point being implementation detail vs not depends significantly on what the
43-
public contract is (e.g., can you supply untrusted data or not), and this
44-
requires careful judgement.
42+
The point being implementation detail vs not depends a lot on what the public
43+
contract is (e.g., can you supply untrusted data or not), and this requires
44+
careful judgement.
4545

4646
Consider if a comment is explaining that a for-loop is used (unnecessary
4747
detail) or if it is explaining that the algorithms used internally have known

src/idiomatic/foundations-api-design/predictable-api/common-traits/serde.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct Data {
3232
erroneously saved to disk or sent over a network, consider not implementing
3333
Serialize/Deserialize for that type.
3434

35-
Shares security concerns with `Debug`, but given serialization is frequently
36-
used in networking there can be higher stakes.
35+
Shares security concerns with `Debug`, but given serialization is often used
36+
in networking there can be higher stakes.
3737

3838
</details>

src/idiomatic/foundations-api-design/predictable-api/naming-conventions/as-and-ref.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ impl OwnedFd {
3636

3737
- Method that returns a borrow of the primary piece of contained data.
3838

39-
- The borrowing relationship is typically straightforward: the return value is a
40-
reference that borrows `self`.
39+
- The borrowing relationship is most often straightforward: the return value is
40+
a reference that borrows `self`.
4141

4242
- Borrowing can also be subtle, and merely implied.
4343

src/idiomatic/foundations-api-design/predictable-api/naming-conventions/by.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ data.
4343

4444
`sort_by` takes a comparator function directly.
4545

46-
- Commonly seen in methods that sort or otherwise manipulate a slice with a
46+
- Most often seen in methods that sort or otherwise manipulate a slice with a
4747
custom sort or comparison function rather than by the `Ord` implementation of
4848
the type itself.
4949

src/idiomatic/foundations-api-design/predictable-api/naming-conventions/with-constructor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ impl<T> Vec<T> {
1818

1919
<details>
2020

21-
- `with` can appear as a constructor prefix, typically when initializing heap
22-
memory for container types.
21+
- `with` can appear as a constructor prefix, most commonly when initializing
22+
heap memory for container types.
2323

2424
In this case, it's distinct from `new` constructors because it specifies the
2525
value for something that is not usually cared about by API users.

src/idiomatic/leveraging-the-type-system.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ minutes: 5
77
Rust's type system is _expressive_: you can use types and traits to build
88
abstractions that make your code harder to misuse.
99

10-
It is possible to enforce correctness at _compile-time_, with no runtime
11-
overhead.
10+
In some cases, you can go as far as enforcing correctness at _compile-time_,
11+
with no runtime overhead.
1212

1313
Types and traits can model concepts and constraints from your business domain.
1414
With careful design, you can improve the clarity and maintainability of the
@@ -18,7 +18,8 @@ entire codebase.
1818

1919
Additional items speaker may mention:
2020

21-
- Rust's type system borrows ideas from functional programming languages.
21+
- Rust's type system borrows a lot of ideas from functional programming
22+
languages.
2223

2324
For example, Rust's enums are known as "algebraic data types" in languages
2425
like Haskell and OCaml. You can take inspiration from learning material geared
@@ -41,9 +42,9 @@ Additional items speaker may mention:
4142
doesn't support inheritance, and object decomposition should take into account
4243
the constraints introduced by the borrow checker.
4344

44-
- Mention that type-level programming creates "zero-cost abstractions", although
45-
the label can be misleading: the impact on compile times and code complexity
46-
may be significant.
45+
- Mention that type-level programming can be often used to create "zero-cost
46+
abstractions", although the label can be misleading: the impact on compile
47+
times and code complexity may be significant.
4748

4849
</details>
4950

src/idiomatic/leveraging-the-type-system/borrow-checker-invariants.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ fn main() {
5959
- We've also used types to shape and restrict APIs already using
6060
[the Typestate pattern](../leveraging-the-type-system/typestate-pattern.md).
6161

62-
- Language features are frequently introduced for a specific purpose.
62+
- Language features are often introduced for a specific purpose.
6363

6464
Over time, users may develop ways of using a feature in ways that were not
6565
predicted when they were introduced.
6666

6767
Java 5 introduced Generics in 2004 with the
6868
[main stated purpose of enabling type-safe collections](https://jcp.org/en/jsr/detail?id=14).
6969

70-
Adoption was slow at first, but several new projects began designing their
71-
APIs around generics from the beginning.
70+
Adoption was slow at first, but some new projects began designing their APIs
71+
around generics from the beginning.
7272

7373
Since then, users and developers of the language expanded the use of generics
7474
to other areas of type-safe API design:

src/idiomatic/leveraging-the-type-system/borrow-checker-invariants/generalizing-ownership.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ fn demo_denied() {
6363
`shared_again_again` reference is taken from `&value`.
6464

6565
- Remember that every `&T` and `&mut T` has a lifetime, just one the user
66-
doesn't have to annotate or think about typically.
66+
doesn't have to annotate or think about most of the time.
6767

6868
We rarely specify lifetimes because the Rust compiler allows us to _elide_
69-
them in the majority of cases. See:
69+
them in most cases. See:
7070
[Lifetime Elision](../../../lifetimes/lifetime-elision.md)
7171

7272
</details>

0 commit comments

Comments
 (0)