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");