dear-imgui-rs 0.14.0

High-level Rust bindings to Dear ImGui v1.92.7 with docking, WGPU/GL backends, and extensions (ImPlot/ImPlot3D, ImNodes, ImGuizmo, file browser, reflection-based UI)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub(super) fn non_negative_count_from_i32(caller: &str, raw: i32) -> usize {
    usize::try_from(raw).unwrap_or_else(|_| panic!("{caller} returned a negative count"))
}

#[cfg(test)]
mod tests {
    #[test]
    fn non_negative_count_conversion_rejects_negative_values() {
        assert_eq!(super::non_negative_count_from_i32("test", 7), 7);
        assert!(
            std::panic::catch_unwind(|| {
                let _ = super::non_negative_count_from_i32("test", -1);
            })
            .is_err()
        );
    }
}