Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct A {
- }
- impl C for A {
- fn test1(&self) -> String {
- return String::from("test #1");
- }
- }
- struct B {
- }
- impl C for B {
- fn test1(&self) -> String {
- return String::from("test #1");
- }
- }
- impl D for B {
- fn test2(&self) -> String {
- return String::from("test #2");
- }
- }
- trait C {
- fn test1(&self) -> String;
- }
- trait D : C {
- fn test2(&self) -> String;
- }
- fn main() {
- let a = A{};
- let b = B{};
- println!("{}", a.test1());
- println!("{}", b.test2());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement