Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 1f82079

Browse files
Merge pull request #697 from GuillaumeGomez/must-use
[gir] Generate #[must_use] where needed
2 parents e351fda + 75dee34 commit 1f82079

23 files changed

+34
-9
lines changed

atk/src/auto/object.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub trait AtkObjectExt: 'static {
7272

7373
#[doc(alias = "atk_object_get_parent")]
7474
#[doc(alias = "get_parent")]
75+
#[must_use]
7576
fn parent(&self) -> Option<Object>;
7677

7778
#[doc(alias = "atk_object_get_role")]
@@ -85,9 +86,11 @@ pub trait AtkObjectExt: 'static {
8586
fn notify_state_change(&self, state: State, value: bool);
8687

8788
#[doc(alias = "atk_object_peek_parent")]
89+
#[must_use]
8890
fn peek_parent(&self) -> Option<Object>;
8991

9092
#[doc(alias = "atk_object_ref_accessible_child")]
93+
#[must_use]
9194
fn ref_accessible_child(&self, i: i32) -> Option<Object>;
9295

9396
#[doc(alias = "atk_object_ref_relation_set")]

atk/src/auto/state_set.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub trait StateSetExt: 'static {
4040
//fn add_states(&self, types: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 68 });
4141

4242
#[doc(alias = "atk_state_set_and_sets")]
43+
#[must_use]
4344
fn and_sets(&self, compare_set: &impl IsA<StateSet>) -> Option<StateSet>;
4445

4546
#[doc(alias = "atk_state_set_clear_states")]
@@ -55,12 +56,14 @@ pub trait StateSetExt: 'static {
5556
fn is_empty(&self) -> bool;
5657

5758
#[doc(alias = "atk_state_set_or_sets")]
59+
#[must_use]
5860
fn or_sets(&self, compare_set: &impl IsA<StateSet>) -> Option<StateSet>;
5961

6062
#[doc(alias = "atk_state_set_remove_state")]
6163
fn remove_state(&self, type_: StateType) -> bool;
6264

6365
#[doc(alias = "atk_state_set_xor_sets")]
66+
#[must_use]
6467
fn xor_sets(&self, compare_set: &impl IsA<StateSet>) -> Option<StateSet>;
6568
}
6669

atk/src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ e1c90d705644)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 79e747a1a188)
22
from gir-files (https://github.com/gtk-rs/gir-files @ 898f6c1fb177)

atk/sys/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ e1c90d705644)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 79e747a1a188)
22
from gir-files (https://github.com/gtk-rs/gir-files @ 898f6c1fb177)

gdk/src/auto/device.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ glib::wrapper! {
4949
impl Device {
5050
#[doc(alias = "gdk_device_get_associated_device")]
5151
#[doc(alias = "get_associated_device")]
52+
#[must_use]
5253
pub fn associated_device(&self) -> Option<Device> {
5354
unsafe { from_glib_none(ffi::gdk_device_get_associated_device(self.to_glib_none().0)) }
5455
}

gdk/src/auto/gl_context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl GLContext {
6060

6161
#[doc(alias = "gdk_gl_context_get_shared_context")]
6262
#[doc(alias = "get_shared_context")]
63+
#[must_use]
6364
pub fn shared_context(&self) -> Option<GLContext> {
6465
unsafe {
6566
from_glib_none(ffi::gdk_gl_context_get_shared_context(

gdk/src/auto/rectangle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl Rectangle {
4545
}
4646

4747
#[doc(alias = "gdk_rectangle_union")]
48+
#[must_use]
4849
pub fn union(&self, src2: &Rectangle) -> Rectangle {
4950
unsafe {
5051
let mut dest = Rectangle::uninitialized();

gdk/src/auto/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ e1c90d705644)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 79e747a1a188)
22
from gir-files (https://github.com/gtk-rs/gir-files @ 898f6c1fb177)

gdk/src/auto/window.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,14 @@ impl Window {
438438

439439
#[doc(alias = "gdk_window_get_effective_parent")]
440440
#[doc(alias = "get_effective_parent")]
441+
#[must_use]
441442
pub fn effective_parent(&self) -> Option<Window> {
442443
unsafe { from_glib_none(ffi::gdk_window_get_effective_parent(self.to_glib_none().0)) }
443444
}
444445

445446
#[doc(alias = "gdk_window_get_effective_toplevel")]
446447
#[doc(alias = "get_effective_toplevel")]
448+
#[must_use]
447449
pub fn effective_toplevel(&self) -> Window {
448450
unsafe {
449451
from_glib_none(ffi::gdk_window_get_effective_toplevel(
@@ -517,6 +519,7 @@ impl Window {
517519

518520
#[doc(alias = "gdk_window_get_group")]
519521
#[doc(alias = "get_group")]
522+
#[must_use]
520523
pub fn group(&self) -> Option<Window> {
521524
unsafe { from_glib_none(ffi::gdk_window_get_group(self.to_glib_none().0)) }
522525
}
@@ -549,6 +552,7 @@ impl Window {
549552

550553
#[doc(alias = "gdk_window_get_parent")]
551554
#[doc(alias = "get_parent")]
555+
#[must_use]
552556
pub fn parent(&self) -> Option<Window> {
553557
unsafe { from_glib_none(ffi::gdk_window_get_parent(self.to_glib_none().0)) }
554558
}
@@ -645,6 +649,7 @@ impl Window {
645649

646650
#[doc(alias = "gdk_window_get_toplevel")]
647651
#[doc(alias = "get_toplevel")]
652+
#[must_use]
648653
pub fn toplevel(&self) -> Window {
649654
unsafe { from_glib_none(ffi::gdk_window_get_toplevel(self.to_glib_none().0)) }
650655
}

gdk/sys/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ e1c90d705644)
1+
Generated by gir (https://github.com/gtk-rs/gir @ 79e747a1a188)
22
from gir-files (https://github.com/gtk-rs/gir-files @ 898f6c1fb177)

0 commit comments

Comments
 (0)