From 8bd13db2425301a9b60a309a79b61c72f1cf79f0 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Tue, 30 May 2023 18:24:51 +0200 Subject: [PATCH] Use result in doctest --- src/format/parse.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/format/parse.rs b/src/format/parse.rs index ca8193e15d..ed3f91f6df 100644 --- a/src/format/parse.rs +++ b/src/format/parse.rs @@ -504,9 +504,10 @@ where /// All of these examples are equivalent: /// ``` /// # use chrono::{DateTime, offset::FixedOffset}; -/// "2012-12-12T12:12:12Z".parse::>(); -/// "2012-12-12 12:12:12Z".parse::>(); -/// "2012- 12-12T12: 12:12Z".parse::>(); +/// "2012-12-12T12:12:12Z".parse::>()?; +/// "2012-12-12 12:12:12Z".parse::>()?; +/// "2012- 12-12T12: 12:12Z".parse::>()?; +/// # Ok::<(), chrono::ParseError>(()) /// ``` impl str::FromStr for DateTime { type Err = ParseError;