Skip to content

Commit 283d0e7

Browse files
committed
Annotate Shell methods with #[must_use]
1 parent 2a144e7 commit 283d0e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/shell.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ impl<'a, Message> Shell<'a, Message> {
3232
}
3333

3434
/// Returns true if the [`Shell`] contains no published messages
35+
#[must_use]
3536
pub fn is_empty(&self) -> bool {
3637
self.messages.is_empty()
3738
}
@@ -50,11 +51,13 @@ impl<'a, Message> Shell<'a, Message> {
5051
}
5152

5253
/// Returns the current [`event::Status`] of the [`Shell`].
54+
#[must_use]
5355
pub fn event_status(&self) -> event::Status {
5456
self.event_status
5557
}
5658

5759
/// Returns whether the current event has been captured.
60+
#[must_use]
5861
pub fn is_event_captured(&self) -> bool {
5962
self.event_status == event::Status::Captured
6063
}
@@ -73,6 +76,7 @@ impl<'a, Message> Shell<'a, Message> {
7376
}
7477

7578
/// Returns the request a redraw should happen, if any.
79+
#[must_use]
7680
pub fn redraw_request(&self) -> window::RedrawRequest {
7781
self.redraw_request
7882
}
@@ -101,16 +105,19 @@ impl<'a, Message> Shell<'a, Message> {
101105
}
102106

103107
/// Returns the current [`InputMethod`] strategy.
108+
#[must_use]
104109
pub fn input_method(&self) -> &InputMethod {
105110
&self.input_method
106111
}
107112

108113
/// Returns the current [`InputMethod`] strategy.
114+
#[must_use]
109115
pub fn input_method_mut(&mut self) -> &mut InputMethod {
110116
&mut self.input_method
111117
}
112118

113119
/// Returns whether the current layout is invalid or not.
120+
#[must_use]
114121
pub fn is_layout_invalid(&self) -> bool {
115122
self.is_layout_invalid
116123
}
@@ -134,6 +141,7 @@ impl<'a, Message> Shell<'a, Message> {
134141

135142
/// Returns whether the widgets of the current application have been
136143
/// invalidated.
144+
#[must_use]
137145
pub fn are_widgets_invalid(&self) -> bool {
138146
self.are_widgets_invalid
139147
}

0 commit comments

Comments
 (0)