diff options
| author | Nadir Fejzic <nadirfejzo@gmail.com> | 2022-11-14 22:37:25 +0100 |
|---|---|---|
| committer | Nadir Fejzic <nadirfejzo@gmail.com> | 2022-11-14 22:37:25 +0100 |
| commit | 0dd6ce0b1931e3e5c274daf4bbf50e96a322befd (patch) | |
| tree | e5e0d2fbcab54e1921cd5ebfaafeffaec7c699ee | |
| parent | 72ab91d8066ee399cff3e3c8293bf4dbccfb6358 (diff) | |
| download | rust-0dd6ce0b1931e3e5c274daf4bbf50e96a322befd.tar.gz rust-0dd6ce0b1931e3e5c274daf4bbf50e96a322befd.zip | |
docs: import Instant and Duration in doctests
| -rw-r--r-- | clippy_lints/src/instant_subtraction.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clippy_lints/src/instant_subtraction.rs b/clippy_lints/src/instant_subtraction.rs index 716c11becd9..60754b224fc 100644 --- a/clippy_lints/src/instant_subtraction.rs +++ b/clippy_lints/src/instant_subtraction.rs @@ -49,11 +49,13 @@ declare_clippy_lint! { /// /// ### Example /// ```rust + /// # use std::time::{Instant, Duration}; /// let time_passed = Instant::now() - Duration::from_secs(5); /// ``` /// /// Use instead: /// ```rust + /// # use std::time::{Instant, Duration}; /// let time_passed = Instant::now().checked_sub(Duration::from_secs(5)); /// ``` /// |
