Guest User

Untitled

a guest
May 27th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. use std::convert::AsRef;
  2.  
  3. #[derive(Debug)]
  4. struct Foo;
  5.  
  6. /*
  7. impl AsRef<str> for Foo {
  8. fn as_ref(&self) -> &str {
  9. "test"
  10. }
  11. }
  12. */
  13.  
  14. fn main() {
  15. let foo = (&Foo).as_ref();
  16.  
  17. println!("{:?}", foo);
  18. }
Add Comment
Please, Sign In to add comment