]> git.lizzy.rs Git - rust.git/commitdiff
Clarify error phrase in `sub_instant` function
authorClaudio Bley <cbley@exa-online.de>
Mon, 4 Jun 2018 06:58:55 +0000 (08:58 +0200)
committerClaudio Bley <cbley@exa-online.de>
Mon, 4 Jun 2018 06:59:09 +0000 (08:59 +0200)
Uses the same wording as [`src/libstd/sys/windows/time.rs`][1].

1: https://github.com/avdv/rust/blob/95e2bf253d864c5e14ad000ffa2040ce85916056/src/libstd/sys/windows/time.rs#L65

src/libstd/sys/redox/time.rs
src/libstd/sys/unix/time.rs

index cf798500b7fd2d716dcccaaa7adb62250b879a88..5c491115c55160dafcc356c2082699454b9b29f4 100644 (file)
@@ -144,7 +144,7 @@ pub fn now() -> Instant {
 
     pub fn sub_instant(&self, other: &Instant) -> Duration {
         self.t.sub_timespec(&other.t).unwrap_or_else(|_| {
-            panic!("other was less than the current instant")
+            panic!("specified instant was later than self")
         })
     }
 
index f7459cb55d5ca7d0f870d7ca2e78cf61f345b875..89786eb2a6c486005c27ba46da3375fa3fd79aa7 100644 (file)
@@ -289,7 +289,7 @@ pub fn now() -> Instant {
 
         pub fn sub_instant(&self, other: &Instant) -> Duration {
             self.t.sub_timespec(&other.t).unwrap_or_else(|_| {
-                panic!("other was greater than the current instant")
+                panic!("specified instant was later than self")
             })
         }