From 7ae71b9f03ec1af39ca7d1f6f4c089e21c674f81 Mon Sep 17 00:00:00 2001 From: Serge Barral Date: Thu, 4 Apr 2024 11:57:21 +0200 Subject: [PATCH] Minor doc improvements --- src/errors.rs | 2 ++ src/lib.rs | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 9196952..59210f0 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -35,6 +35,8 @@ pub enum DateTimeError { InvalidSecond(u8), /// The nanosecond field value is more than 999 999 999. InvalidNanosecond(u32), + /// This date-time value cannot be represented as a TAI timestamp with the + /// specified epoch. OutOfRange, } diff --git a/src/lib.rs b/src/lib.rs index 28eb935..14ee0e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -497,10 +497,11 @@ impl TaiTime { /// Returns an error if any of the arguments is invalid, or if the /// calculated timestamp is outside the representable range. /// - /// While highly improbable, this method will also return an error on - /// arithmetic overflow. This would require `EPOCH_REF` to approach - /// `i64::MIN` or `i64::MAX`, which corresponds to approximately ±292 - /// billion years. + /// While highly improbable, this method will also return a + /// `DateTimeError::OutOfRange` error on arithmetic overflow. This would + /// require `EPOCH_REF` to approach `i64::MIN` or `i64::MAX`, which + /// corresponds to approximately ±292 billion years. This cannot happen with + /// any of the pre-defined `TaiTime` aliases. /// /// /// # Example