Skip to content

Commit

Permalink
Merge pull request #1511 from kawadakk/patch/variant-has-param-spec-b…
Browse files Browse the repository at this point in the history
…uilder-fn-nonstatic

glib: Make `<Variant as HasParamSpec>::BuilderFn` generic over lifetimes
  • Loading branch information
sdroege authored Sep 20, 2024
2 parents a1a0fdc + 83c8f0d commit 4cff6e0
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 4cff6e0

Please sign in to comment.