sas7bdat 0.2.0

Rust library + CLI for decoding SAS7BDAT datasets and streaming them to modern formats.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::Result;

pub fn next_from_result<T, U>(
    result: Result<Option<T>>,
    map_ok: impl FnOnce(T) -> U,
    on_error: impl FnOnce(),
) -> Option<Result<U>> {
    match result {
        Ok(Some(value)) => Some(Ok(map_ok(value))),
        Ok(None) => None,
        Err(err) => {
            on_error();
            Some(Err(err))
        }
    }
}