Advertisement
NLinker

Nice string for T

Jul 14th, 2018
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.22 KB | None | 0 0
  1. // http://play.rust-lang.org/?gist=ed56c0ea31c17399545386416af5b56c
  2. trait Nice {
  3.     fn nice(&self) -> String;
  4. }
  5.  
  6. impl<T: Debug> Nice for T {
  7.     fn nice(&self) -> String {
  8.         format!("{:?}", *self)
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement