Created
June 8, 2013 07:01
-
-
Save kolmodin/5734355 to your computer and use it in GitHub Desktop.
Rust code - type error.
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
fn getString(json: std::json::Json, key: ~str) -> Option<~str> { | |
match json { | |
std::json::Object(map) => { | |
match map.find(&key) { | |
Some(&std::json::String(str)) => Some(~"return str here"), | |
_ => None | |
} | |
}, | |
_ => None | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rust-json.rs:15:28: 15:32 error: by-move pattern bindings may not occur behind @ or & bindings
rust-json.rs:15 Some(&std::json::String(str)) => Some(~"return str here"),
^~~~
error: aborting due to previous error