File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ bitflags::bitflags! {
32
32
}
33
33
}
34
34
35
+ impl Default for ParamFlags {
36
+ fn default ( ) -> Self {
37
+ ParamFlags :: READWRITE
38
+ }
39
+ }
40
+
35
41
#[ doc( hidden) ]
36
42
impl IntoGlib for ParamFlags {
37
43
type GlibType = gobject_ffi:: GParamFlags ;
Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ macro_rules! define_builder {
441
441
name: & ' a str ,
442
442
nick: Option <& ' a str >,
443
443
blurb: Option <& ' a str >,
444
- flags: Option < crate :: ParamFlags > , // `ParamFlags` doesn't implement `Default` so I wrap it in `Option`
444
+ flags: crate :: ParamFlags ,
445
445
$( $field_id: Option <$field_ty>) ,*
446
446
}
447
447
impl <' a> $builder_type<' a> {
@@ -458,7 +458,7 @@ macro_rules! define_builder {
458
458
459
459
/// Default: `glib::ParamFlags::READWRITE`
460
460
pub fn flags( mut self , flags: crate :: ParamFlags ) -> Self {
461
- self . flags = Some ( flags) ;
461
+ self . flags = flags;
462
462
self
463
463
}
464
464
@@ -481,7 +481,7 @@ macro_rules! define_builder {
481
481
$( . or( Some ( $field_expr) ) ) ?
482
482
. expect( "impossible: missing parameter in ParamSpec*Builder" )
483
483
, ) *
484
- self . flags. unwrap_or ( crate :: ParamFlags :: READWRITE ) ,
484
+ self . flags
485
485
)
486
486
}
487
487
}
You can’t perform that action at this time.
0 commit comments