Shared Rust kernels

catalogue/offset

All modules · quoted at commit 9e1884369a67 of DnaCalc/DnaCalc. Comments are the source's own.

span · 9 lines · calc-func/src/catalogue/offset.rs on GitHub
/// The first and last row (or column) of an extent of `size` from `start`: down or right when it
/// is positive, up or left when it is negative.
fn span(start: i64, size: i64) -> (i64, i64) {
    if size > 0 {
        (start, start + size - 1)
    } else {
        (start + size + 1, start)
    }
}

Used by 2 functions.