Skip to content

Commit

Permalink
Add must_use.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Palmieri committed Sep 5, 2021
1 parent ea5cc89 commit 76601e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mock_server/bare_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ pub(super) enum RequestRecording {
/// To improve your debugging experience it is strongly recommended to use [`Mock::named`] to assign a unique
/// identifier to your scoped [`Mock`]s, which will in turn be referenced in the panic message if their expectations are
/// not met.
#[must_use =
"All *_scoped methods return a `MockGuard`.
This guard MUST be bound to a variable (e.g. _mock_guard), \
otherwise the mock will immediately be unmounted (and its expectations checked).
Check `wiremock`'s documentation on scoped mocks for more details."]
pub struct MockGuard {
mock_id: MockId,
server_state: Arc<RwLock<MockServerState>>,
Expand Down

0 comments on commit 76601e3

Please sign in to comment.