Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created March 12, 2018 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/57dd0083a5a0386c0c58f525150bae12 to your computer and use it in GitHub Desktop.
Save rust-play/57dd0083a5a0386c0c58f525150bae12 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
struct Testing{
one: Option<String>
}
impl Testing {
/// redis://[:<passwd>@]<hostname>[:port][/<db>]
pub fn do_something(&self) {
let one = &self.one.unwrap_or_default();
println!("one is: {:?}", one);
}
}
fn main() {
let t = Testing {one: Some("thing".to_string())};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment