Created
March 12, 2018 23:39
-
-
Save rust-play/1b265ac58ea4096a0c2517e68fda788a to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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 Testing{ | |
one: Option<String> | |
} | |
impl Testing { | |
/// redis://[:<passwd>@]<hostname>[:port][/<db>] | |
pub fn do_something(&self) { | |
let one = self.one.as_ref().unwrap(); | |
println!("one is: {:?}", one); | |
} | |
} | |
fn main() { | |
let t = Testing {one: Some("thing".to_string())}; | |
t.do_something(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment