On Tue, Oct 3, 2023 at 11:40 AM Erik Schilling <erik.schilling@xxxxxxxxxx> wrote: > > While one would usually use the ToOwned [1] contract in rust, libgpipd's > API only allows copying that may fail. > > Thus, we cannot implement the existing trait and roll our own method. I > went with `try_clone` since that seems to be used in similar cases across > the `std` crate [2]. > > It also closes the gap of not having any way to clone owned instances. > Though - again - not through the Clone trait which may not fail [3]. > > [1] https://doc.rust-lang.org/std/borrow/trait.ToOwned.html > [2] https://doc.rust-lang.org/std/index.html?search=try_clone > [3] https://doc.rust-lang.org/std/clone/trait.Clone.html > > Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx> > Signed-off-by: Erik Schilling <erik.schilling@xxxxxxxxxx> > --- Applied, thanks! Bart