Skip to content

Commit

Permalink
Merge pull request jonhoo#152 from stevepryde/must-use
Browse files Browse the repository at this point in the history
Add must_use attribute as per clippy
  • Loading branch information
jonhoo authored Feb 5, 2022
2 parents 8497c23 + 5d7f3ba commit 1a71df6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,11 @@ pub trait InputSource: Into<ActionSequence> {
type Action;

/// Add a pause action to the sequence for this input source.
#[must_use]
fn pause(self, duration: Duration) -> Self;

/// Add the specified action to the sequence for this input source.
#[must_use]
fn then(self, action: Self::Action) -> Self;
}

Expand Down Expand Up @@ -524,6 +526,7 @@ pub struct Actions {

impl Actions {
/// Append the specified sequence to the list of sequences.
#[must_use]
pub fn and(mut self, sequence: impl Into<ActionSequence>) -> Self {
self.sequences.push(sequence.into());
self
Expand Down
3 changes: 3 additions & 0 deletions src/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,21 @@ impl<'c> Wait<'c> {
}

/// Set the timeout until the operation should wait.
#[must_use]
pub fn at_most(mut self, timeout: Duration) -> Self {
self.timeout = Some(timeout);
self
}

/// Wait forever.
#[must_use]
pub fn forever(mut self) -> Self {
self.timeout = None;
self
}

/// Sets the period to delay checks.
#[must_use]
pub fn every(mut self, period: Duration) -> Self {
self.period = period;
self
Expand Down

0 comments on commit 1a71df6

Please sign in to comment.