Re: [PATCH 4/7] rust: debugfs: support blobs from smart pointers
From: Matthew Maurer
Date: Fri Oct 03 2025 - 19:36:27 EST
>
> I think this way around is not compatible with scoped API.
>
I thought you'd just be able to deref inside the callback, but perhaps
I'm wrong. I'll try to find a chance to pull down the patch and check.
> >> +// Delegate for `Vec<T, A>`: Support a `Vec<T, A>` with an outer lock.
> >> +impl<T, A> BinaryReaderMut for Vec<T, A>
> >> +where
> >> + T: AsBytes + FromBytes,
> >> + A: Allocator,
> >> +{
> >> + fn read_from_slice_mut(
> >> + &mut self,
> >> + reader: &mut UserSliceReader,
> >> + offset: usize,
> >> + ) -> Result<usize> {
> >> + let slice = self.as_mut_slice();
> >> +
> >
> > Nit: This is safe, but it also requires `FromBytes`, and is &mut, &mut
>
> It already requires T: AsBytes + FromBytes above. Or do you mean something else?
I mean the safety comment. Your code is right, the comment needs to be updated.