Skip to content

Commit 0656e07

Browse files
committed
Move order of traits and abstract classes
1 parent cf39bf2 commit 0656e07

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tests/unit/out/refcount/polymorphism.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,37 @@ pub trait Animal {
1111
}
1212
#[derive(Default)]
1313
pub struct Dog {}
14+
impl Animal for Dog {
15+
fn bark(&self) -> bool {
16+
return true;
17+
}
18+
}
1419
impl Clone for Dog {
1520
fn clone(&self) -> Self {
1621
let mut this = Self {};
1722
this
1823
}
1924
}
2025
impl ByteRepr for Dog {}
21-
impl Animal for Dog {
22-
fn bark(&self) -> bool {
23-
return true;
24-
}
25-
}
2626
#[derive(Default)]
2727
pub struct Cat {}
2828
impl Cat {
2929
fn meow(&self) -> bool {
3030
return true;
3131
}
3232
}
33+
impl Animal for Cat {
34+
fn bark(&self) -> bool {
35+
return false;
36+
}
37+
}
3338
impl Clone for Cat {
3439
fn clone(&self) -> Self {
3540
let mut this = Self {};
3641
this
3742
}
3843
}
3944
impl ByteRepr for Cat {}
40-
impl Animal for Cat {
41-
fn bark(&self) -> bool {
42-
return false;
43-
}
44-
}
4545
pub fn main() {
4646
std::process::exit(main_0());
4747
}

0 commit comments

Comments
 (0)