Skip to content

Commit 14deb7e

Browse files
Formatting.
1 parent ee355ae commit 14deb7e

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ Additional items speaker may mention:
2626
types. ["Domain Modeling Made Functional"][1] is a great resource on the
2727
topic, with examples written in F#.
2828

29-
- Despite Rust's functional roots, functional design patterns don't translate as-is
30-
to Rust. For instance, extensive use of higher-order functions and higher-kinded types can
31-
result in code that is harder to read and maintain. Design patterns in Rust
32-
must take into account (and leverage!) the granular control over mutability
33-
that comes with its borrow checker.
29+
- Despite Rust's functional roots, functional design patterns don't translate
30+
as-is to Rust. For instance, extensive use of higher-order functions and
31+
higher-kinded types can result in code that is harder to read and maintain.
32+
Design patterns in Rust must take into account (and leverage!) the granular
33+
control over mutability that comes with its borrow checker.
3434

3535
- The same caution should be applied to object-oriented design patterns. Rust
36-
doesn't support inheritance, and object decomposition should take into account the
37-
constraints introduced by the borrow checker.
36+
doesn't support inheritance, and object decomposition should take into account
37+
the constraints introduced by the borrow checker.
3838

3939
- Mention that type-level programming can be often used to create "zero-cost
4040
abstractions", although the label can be misleading: the impact on compile

src/idiomatic/leveraging-the-type-system/newtype-pattern/semantic-confusion.md

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

55
# Semantic Confusion
66

7-
When a function takes multiple arguments of the same type, call sites are unclear:
7+
When a function takes multiple arguments of the same type, call sites are
8+
unclear:
89

910
```rust
1011
# struct LoginError;
@@ -49,7 +50,8 @@ login(password, username);
4950

5051
- Nonetheless, note that there are legitimate scenarios where a function may
5152
take multiple arguments of the same type. In those scenarios, if correctness
52-
is of paramount importance, consider using a struct with named fields as input:
53+
is of paramount importance, consider using a struct with named fields as
54+
input:
5355
```rust
5456
pub struct LoginArguments {
5557
pub username: &str,

0 commit comments

Comments
 (0)