-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
RFC: Add RcMut<T> and GcMut<T> wrappers #12724
Comments
I'm hesistant to add extra wrappers. I'd rather prefer that we get |
I would be hesitant to do this, it seems to be favoring If |
I wouldn't say it favorites How would |
Just add autoderef and rename RefCell to Mut, and then you'll have an |
|
I've been musing recently that we may want to consider renaming I'm not too worried about let x = Mut::new(3);
let mut x = 3; The first has an explicit struct Foo {
field1: Mut<T>,
field2: U,
} It's quite clear that in this case |
I'd be on board with a re-rename. I guess cc @pcwalton |
Please move further discussion to the RFCs repo. |
(Closing; please open an issue on the RFCs repo or submit a PR with a concrete proposal to continue the discussion.) |
Working with mutable shared state is currently a bit gross. The crazy
foo.borrow().borrow_mut().get().bar()
stuff will be gone with auto-deref (yay!), but there's still the issue that a type likeRc<RefCell<T>>
is gross looking and offputting to newcomers. I think a reasonable solution would be the introduction of some lightweight wrappers:It's still deferring all of the heavy lifting to
Rc
andRefCell
and should make downstream code cleaner at a pretty minimal cost.Thoughts?
The text was updated successfully, but these errors were encountered: