self_cell icon indicating copy to clipboard operation
self_cell copied to clipboard

Mutable reference on owner in builder

Open gwenn opened this issue 1 year ago • 4 comments

Would it be possible to have &'a mut $Owner:

fn try_new<Err>(
    owner: $Owner,
    dependent_builder: impl for<'a> ::core::ops::FnOnce(&'a mut $Owner) -> Result<$Dependent<'a>, Err>
) -> Result<Self, Err>

instead of

fn try_new<Err>(
    owner: $Owner,
    dependent_builder: impl for<'a> ::core::ops::FnOnce(&'a $Owner) -> Result<$Dependent<'a>, Err>
) -> Result<Self, Err>

(use case: https://github.com/rusqlite/rusqlite/pull/1462/files#diff-c595ea0bc5c6bee5e8dfc649ad92279225e2e9a354b8f4d355fbaf4012ebe1e8R19)

gwenn avatar Aug 18 '24 15:08 gwenn