You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-27Lines changed: 2 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,46 +4,24 @@ An open source book about design patterns and idioms in the Rust programming
4
4
language that you can read [here](https://rust-unofficial.github.io/patterns/).
5
5
6
6
7
-
## Contents
8
-
9
-
[Introduction](intro.md)
10
-
7
+
## TODOs
11
8
12
9
### Idioms
13
10
14
-
*[Constructor](idioms/ctor.md)
15
-
*[Concatenating strings with `format!`](idioms/concat-format.md)
16
-
*[Privacy for extensibility](idioms/priv-extend.md)
17
11
* TODO stability for extensibility
18
12
* TODO trait to separate visibility of methods from visibility of data (https://github.com/sfackler/rust-postgres/blob/v0.9.6/src/lib.rs#L1400)
19
-
*[Collections are smart pointers](idioms/deref.md)
20
13
* TODO leak amplification ("Vec::drain sets the Vec's len to 0 prematurely so that mem::forgetting Drain "only" mem::forgets more stuff. instead of exposing uninitialized memory or having to update the len on every iteration")
21
-
*[Finalisation in destructors](idioms/dtor-finally.md)
22
14
* TODO interior mutability - UnsafeCell, Cell, RefCell
23
-
*[Iterating over an `Option`](idioms/option-iter.md)
24
-
*[`Default` trait](idioms/default.md)
25
-
*[Pass variables to closure](idioms/pass-var-to-closure.md)
26
-
*[`mem::replace(_)` to avoid needless clones](idioms/mem-replace.md)
* TODO FFI usage (By being mindful of how to provide Rust libraries, and make use of existing libraries across the FFI, you can get more out of benefits Rust can bring)
* TODO closures and lifetimes (coupling to lifetime)
40
22
* TODO platform-specific sub-modules (https://github.com/rust-lang/rfcs/blob/master/text/0517-io-os-reform.md#platform-specific-opt-in)
41
23
* TODO Module organisation (by looking at examples such as Rusts `libstd`, and how it integrated into the Rusts source code, lessons can be learned about ergonomic project management and API design. Closely assosciated with platform-specific sub-modules)
42
-
*[Entry API](patterns/entry.md) (TODO Currently just a boilerplate)
43
-
*[Visitor](patterns/visitor.md)
44
-
*[Fold](patterns/fold.md)
45
-
*[Prefer small crates](patterns/small-crates.md)
46
-
*[Contain unsafety in small modules](patterns/unsafe-mods.md)
24
+
*[Entry API](patterns/entry.md) (Currently just a boilerplate)
47
25
* TODO extension traits
48
26
* TODO destructor bombs (ensure linear typing dynamically, e.g., https://github.com/Munksgaard/session-types/commit/0f25ccb7c3bc9f65fa8eaf538233e8fe344a189a)
49
27
* TODO convertible to Foo trait for more generic generics (e.g., http://static.rust-lang.org/doc/master/std/fs/struct.File.html#method.open)
@@ -52,19 +30,16 @@ language that you can read [here](https://rust-unofficial.github.io/patterns/).
52
30
* TODO composition of structs to please the borrow checker
53
31
* TODO `Error` traits and `Result` forwarding
54
32
* TODO graphs
55
-
*[Compose structs together for better borrowing](patterns/compose-structs.md)
56
33
57
34
58
35
### Anti-patterns
59
36
60
37
* TODO thread + catch_panic for exceptions
61
38
* TODO Clone to satisfy the borrow checker
62
-
*[Deref polymorphism](anti_patterns/deref.md)
63
39
* TODO Matching all fields of a struct (back compat)
64
40
* TODO wildcard matches
65
41
* TODO taking an enum rather than having multiple functions
66
42
* TODO `unwrap()`ing every `Result` instead of forwarding it
0 commit comments