Skip to content

Commit

Permalink
glib: Make <Variant as HasParamSpec>::BuilderFn generic over lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
kawadakk authored and bilelmoussaoui committed Sep 26, 2024
1 parent e651fc0 commit b825e64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions glib-macros/tests/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ mod foo {
string_vec: RefCell<Vec<String>>,
#[property(get, set, builder(glib::VariantTy::DOUBLE))]
variant: RefCell<Option<glib::Variant>>,
#[property(get, set, builder(&<Option<i32>>::static_variant_type()))]
variant2: RefCell<Option<glib::Variant>>,
#[property(get = |_| 42.0, set)]
infer_inline_type: RefCell<f64>,
// The following property doesn't store any data. The value of the property is calculated
Expand Down
3 changes: 1 addition & 2 deletions glib/src/param_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2307,8 +2307,7 @@ has_simple_spec!(bool, ParamSpecBoolean, ParamSpecBooleanBuilder);
impl HasParamSpec for crate::Variant {
type ParamSpec = ParamSpecVariant;
type SetValue = Self;
type BuilderFn =
fn(&'static str, ty: &'static crate::VariantTy) -> ParamSpecVariantBuilder<'static>;
type BuilderFn = for<'a> fn(&'a str, ty: &'a crate::VariantTy) -> ParamSpecVariantBuilder<'a>;

fn param_spec_builder() -> Self::BuilderFn {
Self::ParamSpec::builder
Expand Down

0 comments on commit b825e64

Please sign in to comment.