1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-14 10:04:19 +02:00

Formatting.

This commit is contained in:
LukeMathWalker
2025-07-07 13:33:17 +02:00
parent ee355aebd9
commit 14deb7ec4c
2 changed files with 11 additions and 9 deletions

View File

@ -26,15 +26,15 @@ Additional items speaker may mention:
types. ["Domain Modeling Made Functional"][1] is a great resource on the
topic, with examples written in F#.
- Despite Rust's functional roots, functional design patterns don't translate as-is
to Rust. For instance, extensive use of higher-order functions and higher-kinded types can
result in code that is harder to read and maintain. Design patterns in Rust
must take into account (and leverage!) the granular control over mutability
that comes with its borrow checker.
- Despite Rust's functional roots, functional design patterns don't translate
as-is to Rust. For instance, extensive use of higher-order functions and
higher-kinded types can result in code that is harder to read and maintain.
Design patterns in Rust must take into account (and leverage!) the granular
control over mutability that comes with its borrow checker.
- The same caution should be applied to object-oriented design patterns. Rust
doesn't support inheritance, and object decomposition should take into account the
constraints introduced by the borrow checker.
doesn't support inheritance, and object decomposition should take into account
the constraints introduced by the borrow checker.
- Mention that type-level programming can be often used to create "zero-cost
abstractions", although the label can be misleading: the impact on compile

View File

@ -4,7 +4,8 @@ minutes: 5
# Semantic Confusion
When a function takes multiple arguments of the same type, call sites are unclear:
When a function takes multiple arguments of the same type, call sites are
unclear:
```rust
# struct LoginError;
@ -49,7 +50,8 @@ login(password, username);
- Nonetheless, note that there are legitimate scenarios where a function may
take multiple arguments of the same type. In those scenarios, if correctness
is of paramount importance, consider using a struct with named fields as input:
is of paramount importance, consider using a struct with named fields as
input:
```rust
pub struct LoginArguments {
pub username: &str,