/// Preserves only the Result::Ok values in a given collection
Preserves only the Result::Ok values in a given collection
Preserves only the Result :: Ok values in a given collection
pub fn keep_ok<T, E>(results: &[Result<T, E>]) -> impl Iterator<Item = &T> {
  results.iter().filter_map(|res| match res {
    Ok(val) => Some(val),
    Err(_) => None,
  })
}
pub fn keep_ok < T , E > ( results : & [ Result < T , E > ] ) -> impl Iterator < Item = & T > { results . iter ( ) . filter_map ( | res | match res { Ok ( val ) => Some ( val ) , Err ( _ ) => None , } ) }
Preserves only the Result::Ok values in a given collection
Preserves only the Result :: Ok values in a given collection
results
&[Result<T, E>]