Last active
September 9, 2018 04:37
-
-
Save sodiumjoe/75970a02bf9f144c515b7021ba3eecbe to your computer and use it in GitHub Desktop.
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
extern crate reqwest; | |
fn main() { | |
foo(String::from("foo")); | |
} | |
fn foo(s: String) -> Result<(), ()> { | |
let _ = reqwest::multipart::Part::reader(s.as_bytes()); | |
Ok(()) | |
} | |
/* | |
error[E0597]: `s` does not live long enough | |
--> src/main.rs:8:46 | |
| | |
8 | let _ = reqwest::multipart::Part::reader(s.as_bytes()); | |
| ^ borrowed value does not live long enough | |
9 | Ok(()) | |
10 | } | |
| - 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