File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
#![ crate_type = "bin" ]
2
2
//! Example of design pattern inspired from Head First Design Patterns
3
3
//!
4
- //! Tested with rust-1.3 .0
4
+ //! Tested with rust-1.14 .0
5
5
//!
6
6
//! @author Eliovir <http://github.com/~eliovir>
7
7
//!
@@ -32,16 +32,16 @@ impl FlyBehaviour for DoNotFly {
32
32
}
33
33
34
34
// The object has reference to the variation.
35
- struct Duck < ' a > {
36
- fly_behaviour : Box < FlyBehaviour + ' a > ,
35
+ struct Duck {
36
+ fly_behaviour : Box < FlyBehaviour > ,
37
37
}
38
38
39
- impl < ' a > Duck < ' a > {
39
+ impl Duck {
40
40
// a method calls the funciton in the variation.
41
41
fn fly ( & self ) {
42
42
self . fly_behaviour . fly ( ) ;
43
43
}
44
- fn set_fly_behaviour ( & mut self , fly_behaviour : Box < FlyBehaviour + ' a > ) {
44
+ fn set_fly_behaviour ( & mut self , fly_behaviour : Box < FlyBehaviour > ) {
45
45
self . fly_behaviour = fly_behaviour;
46
46
}
47
47
}
You can’t perform that action at this time.
0 commit comments