Last active
January 15, 2018 20:12
-
-
Save BransonGitomeh/b14857c6f497b4a0412e7237fcc3e648 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
| mod africas_talking { | |
| #[derive(Debug)] | |
| pub struct Sms { | |
| sent_time: &'static str, | |
| } | |
| #[derive(Debug)] | |
| pub struct Message { | |
| pub to: &'static str, | |
| pub content: &'static str, | |
| } | |
| impl Sms { | |
| pub fn send(message: &Message) -> Sms { | |
| println!("Our new action: {:?}", message); | |
| let res = Sms { sent_time: "10/10/1996" }; | |
| res | |
| } | |
| } | |
| } | |
| fn main() { | |
| let sms = africas_talking::Message { | |
| to: "07xxxxxxx", | |
| content: "very cool message", | |
| }; | |
| let res = africas_talking::Sms::send(&sms); | |
| println!("Our new action: {:?}", res); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment