summaryrefslogtreecommitdiffhomepage
path: root/mullvad-jni/src/is_null.rs
blob: 9353d7211cd048ae567eac29ff42c9fe82853b13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use jnix::jni::objects::{JObject, JString};
use std::ops::Deref;

pub trait IsNull {
    fn is_null(&self) -> bool;
}

impl<'a> IsNull for JObject<'a> {
    fn is_null(&self) -> bool {
        self.deref().is_null()
    }
}

impl<'a> IsNull for JString<'a> {
    fn is_null(&self) -> bool {
        self.deref().is_null()
    }
}