In #1241, the StringArray iterator was changed from returning Option<&str> to Result<Option<&str>>. I think it should instead have been changed to Result<&str>. The inner Option is unnecessary because it should only ever be None if there is a bug in the iterator implementation. This results in an unnecessary unwrap for the caller. I think the iterator should be:
type Item = Result<&'a str, Error>;
fn next(&mut self) -> Option<Result<&'a str, Error>> {
self.range.next().map(|i| self.arr.get(i).transpose().unwrap())
}
cc @weihanglo @DanielEScherzer
In #1241, the
StringArrayiterator was changed from returningOption<&str>toResult<Option<&str>>. I think it should instead have been changed toResult<&str>. The innerOptionis unnecessary because it should only ever be None if there is a bug in the iterator implementation. This results in an unnecessary unwrap for the caller. I think the iterator should be:cc @weihanglo @DanielEScherzer