Skip to content

Commit 302b995

Browse files
authored
Minor improvements (#414)
1 parent c369e4b commit 302b995

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/atomics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ For instance, say we convince the compiler to emit this logic:
7676
```text
7777
initial state: x = 0, y = 1
7878
79-
THREAD 1 THREAD2
79+
THREAD 1 THREAD 2
8080
y = 3; if x == 1 {
8181
x = 1; y *= 2;
8282
}

src/exception-safety.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ impl<'a, T> Hole<'a, T> {
161161
unsafe {
162162
let elt = ptr::read(&data[pos]);
163163
Hole {
164-
data: data,
164+
data,
165165
elt: Some(elt),
166-
pos: pos,
166+
pos,
167167
}
168168
}
169169
}

src/leaking.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ impl<T> Rc<T> {
134134
// Wouldn't it be nice if heap::allocate worked like this?
135135
let ptr = heap::allocate::<RcBox<T>>();
136136
ptr::write(ptr, RcBox {
137-
data: data,
137+
data,
138138
ref_count: 1,
139139
});
140-
Rc { ptr: ptr }
140+
Rc { ptr }
141141
}
142142
}
143143
@@ -194,7 +194,7 @@ pub fn scoped<'a, F>(f: F) -> JoinGuard<'a>
194194
```
195195

196196
Here `f` is some closure for the other thread to execute. Saying that
197-
`F: Send +'a` is saying that it closes over data that lives for `'a`, and it
197+
`F: Send + 'a` is saying that it closes over data that lives for `'a`, and it
198198
either owns that data or the data was Sync (implying `&data` is Send).
199199

200200
Because JoinGuard has a lifetime, it keeps all the data it closes over

src/vec/vec-final.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<T> RawVec<T> {
2323
// `NonNull::dangling()` doubles as "unallocated" and "zero-sized allocation"
2424
RawVec {
2525
ptr: NonNull::dangling(),
26-
cap: cap,
26+
cap,
2727
}
2828
}
2929

src/vec/vec-zsts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<T> RawVec<T> {
3939
// `NonNull::dangling()` doubles as "unallocated" and "zero-sized allocation"
4040
RawVec {
4141
ptr: NonNull::dangling(),
42-
cap: cap,
42+
cap,
4343
}
4444
}
4545

0 commit comments

Comments
 (0)