Skip to content

Instantly share code, notes, and snippets.

@sodiumjoe
Last active September 9, 2018 04:37
Show Gist options
  • Save sodiumjoe/75970a02bf9f144c515b7021ba3eecbe to your computer and use it in GitHub Desktop.
Save sodiumjoe/75970a02bf9f144c515b7021ba3eecbe to your computer and use it in GitHub Desktop.
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