Okay so I'm using a library which is ffi and uses C, for whatever reason when I'm getting an iterator of values from one of the libraries functions the function never fails but returns some wrong stuff if it does fail. I've already dealt with all the checks to make sure what the user (of this api) is iterating over is correct information or no/less information (if some of its wrong) but i need to wrap all the values of the iterator to a Result even though this library isn't returning options or results so that it works with a bunch of other code (this is a generic trait I'm implementing).
I tried taking my iterator and using
.map(|res| Ok(res))however this does not work because the compiler cannot infer the type fore.I have also tried using
Result<_,_>like.map(|res| Result<res, _>)but apparently this is not an expressionSlight modification to the last one i also tried
.map(|res| new: Result<res, _>)however then the result is non mutable while res is and it once again fails.
So I'm not really sure what to do here. I would really prefer the mapping of all the values to be inline and the error can be anything because there will never be a meaningful error however i still need a Result object for my generic trait.
P.S. im not sure if it will help but the type of res is (alloc::boxed::Box<[u8]>, alloc::boxed::Box<[u8]>).