nmeasis 26.4.1

A memory-safe NMEA 0183 parser with a C FFI
Documentation
/// Writes a string slice into a buffer at the given position, advancing the position.
///
/// # Panics
/// Panics if the buffer is too small. The buffer must be pre-sized using `encoded_len`.
macro_rules! write_str {
    ($buf:expr, $pos:expr, $s:expr) => {{
        let b = $s.as_bytes();
        let end = $pos + b.len();
        $buf[$pos..end].copy_from_slice(b);
        $pos = end;
    }};
}

/// Writes a single byte into a buffer at the given position, advancing the position.
///
/// # Panics
/// Panics if the buffer is too small. The buffer must be pre-sized using `encoded_len`.
macro_rules! write_byte {
    ($buf:expr, $pos:expr, $b:expr) => {{
        $buf[$pos] = $b;
        $pos += 1;
    }};
}

pub(crate) use write_byte;
pub(crate) use write_str;