Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 00f6816

Browse files
improve some of the docs (#814)
1 parent 3ca8b0e commit 00f6816

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

‎insta/src/macros.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ macro_rules! assert_snapshot {
469469
/// Settings configuration macro.
470470
///
471471
/// This macro lets you bind some [`Settings`](crate::Settings) temporarily. The first argument
472-
/// takes key value pairs that should be set, the second is the block to
472+
/// takes key value pairs that should be set, and the second is the block to
473473
/// execute. All settings can be set (`sort_maps => value` maps to `set_sort_maps(value)`).
474-
/// The exception are redactions which can only be set to a vector this way.
474+
/// The exception are redactions, which can only be set to a vector this way.
475475
///
476476
/// This example:
477477
///
@@ -492,7 +492,7 @@ macro_rules! assert_snapshot {
492492
/// });
493493
/// ```
494494
///
495-
/// Note: before insta 0.17 this macro used
495+
/// Note: before insta 0.17, this macro used
496496
/// [`Settings::new`](crate::Settings::new) which meant that original settings
497497
/// were always reset rather than extended.
498498
#[macro_export]

‎insta/src/settings.rs‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ impl ActualSettings {
133133

134134
/// Configures how insta operates at test time.
135135
///
136-
/// Settings are always bound to a thread and some default settings are always
136+
/// Settings are always bound to a thread, and some default settings are always
137137
/// available. These settings can be changed and influence how insta behaves on
138-
/// that thread. They can either temporarily or permanently changed.
138+
/// that thread. They can be either temporarily or permanently changed.
139139
///
140140
/// This can be used to influence how the snapshot macros operate.
141-
/// For instance it can be useful to force ordering of maps when
141+
/// For instance, it can be useful to force ordering of maps when
142142
/// unordered structures are used through settings.
143143
///
144144
/// Some of the settings can be changed but shouldn't as it will make it harder
@@ -195,7 +195,7 @@ impl Settings {
195195
/// Enables forceful sorting of maps before serialization.
196196
///
197197
/// Note that this only applies to snapshots that undergo serialization
198-
/// (eg: does not work for [`assert_debug_snapshot!`](crate::assert_debug_snapshot!).)
198+
/// (eg: does not work for [`assert_debug_snapshot!`](crate::assert_debug_snapshot!)).
199199
///
200200
/// The default value is `false`.
201201
pub fn set_sort_maps(&mut self, value: bool) {
@@ -244,8 +244,8 @@ impl Settings {
244244
/// Sets the snapshot suffix.
245245
///
246246
/// The snapshot suffix is added to all snapshot names with an `@` sign
247-
/// between. For instance if the snapshot suffix is set to `"foo"` and
248-
/// the snapshot would be named `"snapshot"` it turns into `"snapshot@foo"`.
247+
/// between. For instance, if the snapshot suffix is set to `"foo"`, and
248+
/// the snapshot would be named `"snapshot"`, it turns into `"snapshot@foo"`.
249249
/// This is useful to separate snapshots if you want to use test
250250
/// parameterization.
251251
pub fn set_snapshot_suffix<I: Into<String>>(&mut self, suffix: I) {
@@ -268,7 +268,7 @@ impl Settings {
268268

269269
/// Sets the input file reference.
270270
///
271-
/// This value is completely unused by the snapshot testing system but it
271+
/// This value is completely unused by the snapshot testing system, but it
272272
/// allows storing some metadata with a snapshot that refers back to the
273273
/// input file. The path stored here is made relative to the workspace root
274274
/// before storing with the snapshot.
@@ -289,8 +289,8 @@ impl Settings {
289289
/// Sets the description.
290290
///
291291
/// The description is stored alongside the snapshot and will be displayed
292-
/// in the diff UI. When a snapshot is captured the Rust expression for that
293-
/// snapshot is always retained. However sometimes that information is not
292+
/// in the diff UI. When a snapshot is captured, the Rust expression for that
293+
/// snapshot is always retained. However, sometimes that information is not
294294
/// super useful by itself, particularly when working with loops and generated
295295
/// tests. In that case the `description` can be set as extra information.
296296
///
@@ -478,7 +478,7 @@ impl Settings {
478478

479479
/// Sets the snapshot path.
480480
///
481-
/// If not absolute it's relative to where the test is in.
481+
/// If not absolute, it's relative to where the test is in.
482482
///
483483
/// Defaults to `snapshots`.
484484
pub fn set_snapshot_path<P: AsRef<Path>>(&mut self, path: P) {
@@ -559,9 +559,9 @@ impl Settings {
559559
/// Binds the settings to the current thread and resets when the drop
560560
/// guard is released.
561561
///
562-
/// This is the recommended way to temporarily bind settings and replaces
563-
/// the earlier [`bind_to_scope`](Settings::bind_to_scope) and relies on
564-
/// drop guards. An alternative is [`bind`](Settings::bind) which binds
562+
/// This is the recommended way to temporarily bind settings. It replaces
563+
/// the earlier [`bind_to_scope`](Settings::bind_to_scope), and relies on
564+
/// drop guards. An alternative is [`bind`](Settings::bind), which binds
565565
/// for the duration of the block it wraps.
566566
///
567567
/// ```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /