File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4040//!
4141//! ## Examples
4242//!
43- //! Consider a situation where we want to log out a value passed to a function.
44- //! We know the value we're working on implements Debug, but we don't know its
43+ //! Consider a situation where we want to log a value passed to a function.
44+ //! We know the value we're working on implements ` Debug` , but we don't know its
4545//! concrete type. We want to give special treatment to certain types: in this
46- //! case printing out the length of String values prior to their value.
46+ //! case printing out the length of ` String` values prior to their value.
4747//! We don't know the concrete type of our value at compile time, so we need to
4848//! use runtime reflection instead.
4949//!
5050//! ```rust
5151//! use std::fmt::Debug;
5252//! use std::any::Any;
5353//!
54- //! // Logger function for any type that implements Debug.
54+ //! // Logger function for any type that implements ` Debug` .
5555//! fn log<T: Any + Debug>(value: &T) {
5656//! let value_any = value as &dyn Any;
5757//!
You can’t perform that action at this time.
0 commit comments