LLFourn / secp256kfun

A pure-rust secp256k1 library optimised for fun
BSD Zero Clause License
100 stars 29 forks source link

Make API of op::lincomb not require collecting first #125

Closed LLFourn closed 7 months ago

LLFourn commented 1 year ago

see #116

LLFourn commented 1 year ago

So I tried to do this just now. The problem I ran into is that you can't really take an IntoIterator<Item=impl Borrow<Something>> and then map Something to a property of it (which we need to do here to get the backend scalar/point). We could take an Iterator and map it but not an IntoIterator since we can't borrow from each iteration. Making it take plain Iterator would solve the issue @sanket1729 was having but seems like it would make the API more clunky where you want to pass in a vector without calling into_iter yourself.

Opting to leave it like it is now until we think of some way of doing both.