coolreader18 opened PR #5855 from data-lifetime
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->I ran into a case where because
Memory::data_and_store_mut
returns a&'a mut T
, I was expectingStoreContext::data
to return a&'a T
, but that wasn't the case despite it being perfectly sound for it to do so. (was trying to make adata_and_store(impl Into<StoreContext<'a, T>>) -> (&'a [u8], &'a T)
convenience function in my project but it failed to compile for the aforementioned reason)Also added a
StoreContext: From<StoreContextMut>
impl, which would probably be useful for something in context/data/memory juggling even if I can't think of what specifically off the top of my head.
alexcrichton submitted PR review.
alexcrichton merged PR #5855.
Last updated: Dec 23 2024 at 12:05 UTC