Created
March 14, 2018 01:03
-
-
Save rust-play/d0d62e94ccf80623fa81d9100e405b71 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt::Display; | |
trait Bar<T: Display> { | |
fn foo(&self, s: T) { | |
println!("{}", s) | |
} | |
} | |
struct Foo; | |
impl<'a> Bar<&'a str> for Foo {} | |
fn main() { | |
let foo = Foo; | |
foo.foo("hi"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment