Skip to content

Commit 26b347a

Browse files
authored
Merge pull request #1131 from johnmendel/main
fix(traits5): make exercise prefer trait-based solution
2 parents 3c85fc4 + a0a0623 commit 26b347a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

exercises/traits/traits5.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@ pub trait OtherTrait {
1818
}
1919
}
2020

21-
struct SomeStruct {
22-
name: String,
23-
}
21+
struct SomeStruct {}
22+
struct OtherStruct {}
2423

2524
impl SomeTrait for SomeStruct {}
2625
impl OtherTrait for SomeStruct {}
26+
impl SomeTrait for OtherStruct {}
27+
impl OtherTrait for OtherStruct {}
2728

2829
// YOU MAY ONLY CHANGE THE NEXT LINE
2930
fn some_func(item: ??) -> bool {
3031
item.some_function() && item.other_function()
3132
}
3233

33-
fn main() {}
34+
fn main() {
35+
some_func(SomeStruct {});
36+
some_func(OtherStruct {});
37+
}

0 commit comments

Comments
 (0)