Created
December 16, 2017 18:30
-
-
Save cdaringe/74282a8e08fc19f25c8a32dd3a01b97c to your computer and use it in GitHub Desktop.
mod.rs
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
#[get("/thing")] | |
fn thing<'a>() -> content::Json<&'static str> { | |
let res : String = SOME_JSON_VALUE.dump(); | |
return content::Json(res.as_str()); | |
} | |
error[E0597]: `res` does not live long enough | |
--> src/main.rs:33:26 | |
| | |
33 | return content::Json(res.as_str()); | |
| ^^^ does not live long enough | |
34 | } | |
| - borrowed value only lives until here | |
| | |
= note: borrowed value must be valid for the static lifetime... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment