Skip to content

Commit 722ad59

Browse files
committed
glib: Also check for subtypes in Object::has_property_with_type()
1 parent 883d630 commit 722ad59

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

glib/src/object.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3328,10 +3328,11 @@ pub unsafe trait ObjectClassExt {
33283328
}
33293329

33303330
// rustdoc-stripper-ignore-next
3331-
/// Check if the object class has a property `property_name` of the given `type_`.
3331+
/// Check if the object class has a property `property_name` of the given `type_`
3332+
/// or a subtype of it.
33323333
fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool {
33333334
self.property_type(property_name)
3334-
.is_some_and(|ptype| ptype == type_)
3335+
.is_some_and(|ptype| ptype.is_a(type_))
33353336
}
33363337

33373338
// rustdoc-stripper-ignore-next
@@ -4274,10 +4275,11 @@ impl<T: IsA<Object> + IsInterface> Interface<T> {
42744275
}
42754276

42764277
// rustdoc-stripper-ignore-next
4277-
/// Check if the interface has a property `property_name` of the given `type_`.
4278+
/// Check if the interface has a property `property_name` of the given `type_`
4279+
/// or a subtype of it.
42784280
pub fn has_property_with_type(&self, property_name: &str, type_: Type) -> bool {
42794281
self.property_type(property_name)
4280-
.is_some_and(|ptype| ptype == type_)
4282+
.is_some_and(|ptype| ptype.is_a(type_))
42814283
}
42824284

42834285
// rustdoc-stripper-ignore-next

0 commit comments

Comments
 (0)