Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fmt::{self,Display,Formatter};
- use std::string::ToString;
- struct Foo<T>(T);
- impl<T: Display> Display for Foo<T> {
- fn fmt(&self, _f: &mut Formatter) -> fmt::Result {
- Ok(())
- }
- }
- fn main() {
- let to_string = ToString::to_string;
- let i = 1;
- let b = &i;
- assert_eq!("bar", to_string(&b));
- }
Add Comment
Please, Sign In to add comment