File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ Systems Level
48
48
Language] ( http://www.cs.indiana.edu/~eholk/papers/hips2013.pdf ) . Early GPU work by Eric Holk.
49
49
* [ Parallel closures: a new twist on an old
50
50
idea] ( https://www.usenix.org/conference/hotpar12/parallel-closures-new-twist-old-idea )
51
- - not exactly about rust , but by nmatsakis
51
+ - not exactly about Rust , but by nmatsakis
52
52
* [ Patina: A Formalization of the Rust Programming
53
53
Language] ( ftp://ftp.cs.washington.edu/tr/2015/03/UW-CSE-15-03-02.pdf ) . Early
54
54
formalization of a subset of the type system, by Eric Reed.
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ borrow checker. Generally we know that such mutations won't happen in a nested f
204
204
to check.
205
205
206
206
For large, complicated programs, it becomes useful to put some things in ` RefCell ` s to make things
207
- simpler. For example, a lot of the maps in [ the ` ctxt ` struct] [ ctxt ] in the rust compiler internals
207
+ simpler. For example, a lot of the maps in [ the ` ctxt ` struct] [ ctxt ] in the Rust compiler internals
208
208
are inside this wrapper. These are only modified once (during creation, which is not right after
209
209
initialization) or a couple of times in well-separated places. However, since this struct is
210
210
pervasively used everywhere, juggling mutable and immutable pointers would be hard (perhaps
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ owners!
150
150
So, we need some type that lets us have more than one reference to a value and
151
151
that we can share between threads, that is it must implement ` Sync ` .
152
152
153
- We'll use ` Arc<T> ` , rust 's standard atomic reference count type, which
153
+ We'll use ` Arc<T> ` , Rust 's standard atomic reference count type, which
154
154
wraps a value up with some extra runtime bookkeeping which allows us to
155
155
share the ownership of the value between multiple references at the same time.
156
156
Original file line number Diff line number Diff line change @@ -279,11 +279,11 @@ fn extension(file_name: &str) -> Option<&str> {
279
279
}
280
280
```
281
281
282
- One other pattern that we find is very common is assigning a default value to
283
- the case when an ` Option ` value is ` None ` . For example, maybe your program
284
- assumes that the extension of a file is ` rs ` even if none is present. As you
285
- might imagine, the case analysis for this is not specific to file
286
- extensions - it can work with any ` Option<T> ` :
282
+ One other pattern we commonly find is assigning a default value to the case
283
+ when an ` Option ` value is ` None ` . For example, maybe your program assumes that
284
+ the extension of a file is ` rs ` even if none is present. As you might imagine,
285
+ the case analysis for this is not specific to file extensions - it can work
286
+ with any ` Option<T> ` :
287
287
288
288
``` rust
289
289
fn unwrap_or <T >(option : Option <T >, default : T ) -> T {
You can’t perform that action at this time.
0 commit comments