Created
April 19, 2019 15:23
-
-
Save 0X1A/70b3d2209336bd4606768c2e5c9e9635 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyStruct {} | |
trait SayHi { | |
fn hi(name: String) -> bool; | |
} | |
impl SayHi for MyStruct { | |
fn hi(name: String) -> bool { | |
print "Hi from " + name + "!"; | |
return true; | |
} | |
} | |
let struct_instance: MyStruct = MyStruct(); | |
let return_value: bool = struct_instance.hi("Lang"); | |
print return_value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment