Skip to content

Add return type to Yoke::with_mut and Yokeable::transform_mut #5368

Open
@jdygert-spok

Description

@jdygert-spok

I believe this is still sound since R can't involve 'b.

fn with_mut<'a, F, R>(&'a mut self, f: F) -> R
where
    F: 'static + for<'b> FnOnce(&'b mut <Y as Yokeable<'a>>::Output) -> R;

fn transform_mut<F, R>(&'a mut self, f: F) -> R
where
    F: 'static + for<'b> FnOnce(&'b mut Self::Output) -> R;

This would be a breaking change, mainly for anyone manually implementing Yokeable.

Notably, this lets us easily call Iterator::next on an iter in a yoke, or even implement Iterator for Yoke.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-zerovecComponent: Yoke, ZeroVec, DataBake

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions