Closed
Description
I'm not sure if this deserves a proper RFC or not, but since I consider this to be a bug I figure it makes sense here :)
I just ran into a bug where I assumed that RefCell::get
follows our convention of .get()
methods returning a &T
pointer, and I was surprised to find that RefCell::get
is actually:
impl<T:Clone> RefCell<T> {
pub fn get(&self) -> T {
(*self.borrow()).clone()
}
...
}
It's surprising, and it can be easily replaced with x.borrow().clone()
if a copy is actually needed. I propose we just remove it.
Metadata
Metadata
Assignees
Labels
No labels