Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements #414

Merged
merged 3 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/atomics.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ For instance, say we convince the compiler to emit this logic:
```text
initial state: x = 0, y = 1

THREAD 1 THREAD2
THREAD 1 THREAD 2
y = 3; if x == 1 {
x = 1; y *= 2;
}
Expand Down
4 changes: 2 additions & 2 deletions src/exception-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ impl<'a, T> Hole<'a, T> {
unsafe {
let elt = ptr::read(&data[pos]);
Hole {
data: data,
data,
elt: Some(elt),
pos: pos,
pos,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/leaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ impl<T> Rc<T> {
// Wouldn't it be nice if heap::allocate worked like this?
let ptr = heap::allocate::<RcBox<T>>();
ptr::write(ptr, RcBox {
data: data,
data,
ref_count: 1,
});
Rc { ptr: ptr }
Rc { ptr }
}
}

Expand Down Expand Up @@ -194,7 +194,7 @@ pub fn scoped<'a, F>(f: F) -> JoinGuard<'a>
```

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

Because JoinGuard has a lifetime, it keeps all the data it closes over
Expand Down
2 changes: 1 addition & 1 deletion src/vec/vec-final.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<T> RawVec<T> {
// `NonNull::dangling()` doubles as "unallocated" and "zero-sized allocation"
RawVec {
ptr: NonNull::dangling(),
cap: cap,
cap,
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/vec/vec-zsts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<T> RawVec<T> {
// `NonNull::dangling()` doubles as "unallocated" and "zero-sized allocation"
RawVec {
ptr: NonNull::dangling(),
cap: cap,
cap,
}
}

Expand Down