Skip to content

Commit

Permalink
chore: fix doc test lints
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiapple852 committed Dec 10, 2023
1 parent 9794f80 commit 7d0c555
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions bounded-static/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Cow<'a, str>>,
//! # }
//! # 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: 'static>(_: T) {}
//! let s = String::from("data");
Expand Down

0 comments on commit 7d0c555

Please sign in to comment.