-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
You can currently borrow an rvalue as & or move out of it, but can't borrow it as &mut.
The use case for this is making external iterators more convenient to use by not requiring a temporary. Instead of let mut it = x.chain(y).zip(z); for it.advance |x| { ... }
it could just be for x.chain(y).zip(z).advance |x| { ... }
.
I've run into this in a few other places but I didn't think twice about it and just did the temporary workaround - but after some thought this seems like an unnecessary restriction.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.