Skip to content

Commit

Permalink
Remove special case for Cell-like types
Browse files Browse the repository at this point in the history
Cell now works for non-Copy types and exposes get_mut for them.
  • Loading branch information
dtolnay committed Oct 28, 2017
1 parent 3bb4d58 commit ee56222
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,6 @@ fn get(&self) -> &V;
fn get_mut(&mut self) -> &mut V;
```

Single-element containers where the element is [`Copy`] (e.g. [`Cell`]-like
containers) should instead return the value directly, and not implement a
mutable accessor. TODO [api-guidelines#44]

[api-guidelines#44]: https://github.com/rust-lang-nursery/api-guidelines/issues/44

[`Copy`]: https://doc.rust-lang.org/std/marker/trait.Copy.html
[`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html

```rust
fn get(&self) -> V;
```

For getters that do runtime validation, consider adding unsafe `_unchecked`
variants.

Expand Down

0 comments on commit ee56222

Please sign in to comment.