Skip to content

Instantly share code, notes, and snippets.

@BransonGitomeh
Last active January 15, 2018 20:12
Show Gist options
  • Select an option

  • Save BransonGitomeh/b14857c6f497b4a0412e7237fcc3e648 to your computer and use it in GitHub Desktop.

Select an option

Save BransonGitomeh/b14857c6f497b4a0412e7237fcc3e648 to your computer and use it in GitHub Desktop.
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