From 5585e85b81f95f8389608dc4c27b5ab671ca5a57 Mon Sep 17 00:00:00 2001 From: FujiApple Date: Sun, 10 Dec 2023 10:45:13 +0800 Subject: [PATCH] chore: fix doc test lints --- bounded-static/src/lib.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bounded-static/src/lib.rs b/bounded-static/src/lib.rs index ab0829d..761a6f1 100644 --- a/bounded-static/src/lib.rs +++ b/bounded-static/src/lib.rs @@ -96,10 +96,22 @@ //! } //! ``` //! -//! This allows is to convert to an owned representation such that it is now bounded by `'static`: +//! This allows it to be converted to an owned representation such that it is now bounded by `'static`: //! //! ```rust -//! #[test] +//! # use std::borrow::Cow; +//! # use bounded_static::ToBoundedStatic; +//! # struct Foo<'a> { +//! # bar: Cow<'a, str>, +//! # baz: Vec>, +//! # } +//! # impl ToBoundedStatic for Foo<'_> { +//! # type Static = Foo<'static>; +//! # +//! # fn to_static(&self) -> Self::Static { +//! # Foo { bar: self.bar.to_static(), baz: self.baz.to_static() } +//! # } +//! # } //! fn test() { //! # fn ensure_static(_: T) {} //! let s = String::from("data");