oj_notify 0.2.48

Fork of notify 9.0.0-rc.6 maintained for oj, carrying the unreleased upstream FSEvents fix that preserves pending events across watch changes (notify-rs/notify#1033). Use upstream notify unless you need this fix.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
/// Native inotify shipped in FreeBSD 14.5 and later (including 15.0+).
const FREEBSD_INOTIFY_MIN: (u32, u32) = (14, 5);

/// Parse `freebsd-version -u` output, e.g. `14.5-RELEASE-p1` → `(14, 5)`.
fn parse_freebsd_release(output: &str) -> Option<(u32, u32)> {
    let (major_str, rest) = output.trim().split_once('.')?;
    let major = major_str.parse().ok()?;
    let minor_len = rest
        .find(|c: char| !c.is_ascii_digit())
        .unwrap_or(rest.len());
    let minor = rest.get(..minor_len)?.parse().ok()?;
    Some((major, minor))
}