From ee56222375cf3de2599f3f6c09514b5b43211898 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 28 Oct 2017 19:32:40 -0400 Subject: [PATCH] Remove special case for Cell-like types Cell now works for non-Copy types and exposes get_mut for them. --- src/naming.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/naming.md b/src/naming.md index 6852cff..bdaa244 100644 --- a/src/naming.md +++ b/src/naming.md @@ -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.