]> git.lizzy.rs Git - rust.git/commitdiff
Improve panic docs for Instant::duration_since
authorOthers <gregorpeach@gmail.com>
Sat, 15 Jul 2017 20:23:11 +0000 (16:23 -0400)
committerGitHub <noreply@github.com>
Sat, 15 Jul 2017 20:23:11 +0000 (16:23 -0400)
The docs for Instant::duration_since has a confusing section on panicking. It's
much more clear without the second two sentences of description.

src/libstd/time/mod.rs

index e4b8d457e2d29dcee1dd107fdc4706231b5ad413..4eed336a7a00d27c59f19ee9656341b24e2b369c 100644 (file)
@@ -163,10 +163,7 @@ pub fn now() -> Instant {
     ///
     /// # Panics
     ///
-    /// This function will panic if `earlier` is later than `self`, which should
-    /// only be possible if `earlier` was created after `self`. Because
-    /// `Instant` is monotonic, the only time that this should happen should be
-    /// a bug.
+    /// This function will panic if `earlier` is later than `self`.
     ///
     /// # Examples
     ///