From bde7d918cd9ce816a2b25792b88cdb2c71f8e65f Mon Sep 17 00:00:00 2001 From: benaryorg Date: Wed, 17 Aug 2016 00:41:54 +0200 Subject: [PATCH] fix code for method Signed-off-by: benaryorg --- text/0000-duration-checked-sub.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/0000-duration-checked-sub.md b/text/0000-duration-checked-sub.md index 5edca47239e..2ce627b1b9b 100644 --- a/text/0000-duration-checked-sub.md +++ b/text/0000-duration-checked-sub.md @@ -54,7 +54,7 @@ underlying primitive types: ```rust impl Duration { - fn checked_sub(self, rhs: Duration) -> Duration { + fn checked_sub(self, rhs: Duration) -> Option { if let Some(mut secs) = self.secs.checked_sub(rhs.secs) { let nanos = if self.nanos >= rhs.nanos { self.nanos - rhs.nanos @@ -67,7 +67,7 @@ impl Duration { } }; debug_assert!(nanos < NANOS_PER_SEC); - Duration { secs: secs, nanos: nanos } + Some(Duration { secs: secs, nanos: nanos }) } else { None