slint icon indicating copy to clipboard operation
slint copied to clipboard

Make VecModel::remove() return the removed value like Vec

Open lukas-jung opened this issue 2 years ago • 3 comments

VecModel's remove() currently just removes the element but does not return it. VecModel should behave similar to Vec so we should change this behavior.

lukas-jung avatar May 02 '22 15:05 lukas-jung

I'm curious, why is this a breaking change?

tronical avatar Jul 25 '22 09:07 tronical

If you change the return value of a function, it is a breaking change.

fn remove(model: &mut VecModel) {
    model.remove(42) // note: no semi colon
}

ogoffart avatar Jul 25 '22 09:07 ogoffart

Thanks, makes sense :)

tronical avatar Jul 25 '22 09:07 tronical