From df0dc490ff8674efbfead5db4b0672ad665d6d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kj=C3=A6r?= Date: Sat, 24 Jul 2021 12:32:51 +0100 Subject: [PATCH 1/2] Remove ? from the Uuid::new_v4 example It seems Uuid no longer implements `Try`, which makes Uuid::new_v4()? fail compilation. The `?` was removed from the README in commit 8962ef612e8b830a5e58a7cfb364c262fcccf432 but was not removed from the rust-doc in lib.rs. Additionally, this also hides `#[cfg(feature = "v4")]` from the docs. --- src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2412aba0..22c7d127 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -92,12 +92,11 @@ //! //! use uuid::Uuid; //! -//! fn main() -> Result<(), Box> { -//! #[cfg(feature = "v4")] { -//! let my_uuid = Uuid::new_v4()?; -//! println!("{}", my_uuid); -//! } -//! Ok(()) +//! fn main() { +//! # #[cfg(feature = "v4")] { +//! let my_uuid = Uuid::new_v4(); +//! println!("{}", my_uuid); +//! # } //! } //! ``` //! From a0dcc9bf3414c329d53e70fb7c6da3c4469200b3 Mon Sep 17 00:00:00 2001 From: Christian Kjaer Laustsen Date: Sat, 24 Jul 2021 13:39:54 +0200 Subject: [PATCH 2/2] Enable doc testing of Uuid::new_v4 example The doc testing of the Uuid::new_v4() example was currently disabled, but after fixing the errors in df0dc49 the test is now working again. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 22c7d127..a8e56339 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -87,7 +87,7 @@ //! //! To create a new random (V4) UUID and print it out in hexadecimal form: //! -//! ```ignore,rust +//! ```rust //! // Note that this requires the `v4` feature enabled in the uuid crate. //! //! use uuid::Uuid; @@ -95,7 +95,7 @@ //! fn main() { //! # #[cfg(feature = "v4")] { //! let my_uuid = Uuid::new_v4(); -//! println!("{}", my_uuid); +//! println!("{}", my_uuid) //! # } //! } //! ```