Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 109acc8

Browse files
committed
Ensure that Priority's Default impl always uses the correct default value
1 parent 2ddffc0 commit 109acc8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/source.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub fn source_remove(source_id: SourceId) {
262262

263263
/// The priority of sources
264264
///
265-
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
265+
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
266266
pub struct Priority(i32);
267267

268268
impl ToGlib for Priority {
@@ -281,6 +281,12 @@ impl FromGlib<i32> for Priority {
281281
}
282282
}
283283

284+
impl Default for Priority {
285+
fn default() -> Priority {
286+
PRIORITY_DEFAULT
287+
}
288+
}
289+
284290
pub const PRIORITY_HIGH: Priority = Priority(glib_ffi::G_PRIORITY_HIGH);
285291
pub const PRIORITY_DEFAULT: Priority = Priority(glib_ffi::G_PRIORITY_DEFAULT);
286292
pub const PRIORITY_HIGH_IDLE: Priority = Priority(glib_ffi::G_PRIORITY_HIGH_IDLE);

0 commit comments

Comments
 (0)