Skip to content

Commit e39dc36

Browse files
authored
Merge pull request #267 from epage/must
fix: Add must_use before assertions are applied
2 parents 7b8fd99 + d947cb0 commit e39dc36

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/assert.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub trait OutputAssertExt {
4747
/// ```
4848
///
4949
/// [`Output`]: std::process::Output
50+
#[must_use]
5051
fn assert(self) -> Assert;
5152
}
5253

@@ -95,6 +96,7 @@ impl Assert {
9596
/// Create an `Assert` for a given [`Output`].
9697
///
9798
/// [`Output`]: std::process::Output
99+
#[must_use]
98100
pub fn new(output: process::Output) -> Self {
99101
Self {
100102
output,
@@ -124,6 +126,7 @@ impl Assert {
124126
/// .append_context("main", "no args")
125127
/// .success();
126128
/// ```
129+
#[must_use]
127130
pub fn append_context<D>(mut self, name: &'static str, context: D) -> Self
128131
where
129132
D: fmt::Display + Send + Sync + 'static,

src/cmd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ impl Command {
186186
/// ```
187187
///
188188
/// [`Output`]: std::process::Output
189+
#[must_use]
189190
pub fn assert(&mut self) -> Assert {
190191
OutputAssertExt::assert(self)
191192
}

0 commit comments

Comments
 (0)