Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::io;
- trait WriteExt {
- fn write_ext(&self) { println!("I implement WriteExt"); }
- }
- impl<W: io::Write> WriteExt for W {
- }
- fn test_fn<W: WriteExt>(mut w: W) {
- w.write_ext();
- test_fn(&mut w);
- }
- fn main() {
- println!("Hello, world!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement