Skip to content

Commit 362eb95

Browse files
committed
Mark SettingsBindDropGuard as must_use
1 parent 7bd287e commit 362eb95

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ All notable changes to insta and cargo-insta are documented here.
44

55
## 1.30.0
66

7-
- Write inline snapshots with atomic rename to avoid some rare races. (#373)
8-
- Pass `--color=...` to libtest to propagate color choices in more situations. (#375)
7+
- Mark settings drop guard as `#[must_use]`.
8+
- Write inline snapshots with atomic rename to avoid some rare races. (#373)
9+
- Pass `--color=...` to libtest to propagate color choices in more situations. (#375)
910

1011
## 1.29.0
1112

src/settings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ impl Settings {
580580
}
581581

582582
/// Returned from [`bind_to_scope`](Settings::bind_to_scope)
583+
#[must_use = "The guard is immediately dropped so binding has no effect. Use `let _guard = ...` to bind it."]
583584
pub struct SettingsBindDropGuard(Option<Arc<ActualSettings>>);
584585

585586
impl Drop for SettingsBindDropGuard {

0 commit comments

Comments
 (0)