Skip to content

Commit 459c298

Browse files
authored
Merge pull request #907 from sdroege/param-spec-is
glib: Add `ParamSpec::is()` helper function
2 parents 5e7661c + df0fdee commit 459c298

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

glib/src/param_spec.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ impl ParamSpec {
148148
}
149149
}
150150

151+
#[inline]
152+
pub fn is<T: StaticType>(&self) -> bool {
153+
self.type_().is_a(T::static_type())
154+
}
155+
151156
#[doc(alias = "get_value_type")]
152157
#[inline]
153158
pub fn value_type(&self) -> crate::Type {

0 commit comments

Comments
 (0)