graphitepdf_utils/
optional.rs1pub fn is_nil<T>(value: &Option<T>) -> bool {
2 value.is_none()
3}
4
5#[cfg(test)]
6mod tests {
7 use super::*;
8
9 #[test]
10 fn detects_none_as_nil() {
11 assert!(is_nil(&None::<i32>));
12 assert!(!is_nil(&Some(0)));
13 }
14}