Skip to content

Instantly share code, notes, and snippets.

@trimoq
Last active March 25, 2020 11:03
Show Gist options
  • Save trimoq/387ef134926d67b778aaa503d65d4f5c to your computer and use it in GitHub Desktop.
Save trimoq/387ef134926d67b778aaa503d65d4f5c to your computer and use it in GitHub Desktop.
Unfinished APIs lead to weird code wrapping around them
bucket
.put_object(&target_path, &bytes, "image/jpg")
.map(|_| ()) // we don't need the result since it is broken anyway
.map_err(|e|
Box::new(NetworkError::UploadPutError(
e.description.unwrap_or("Generic upload error".into()).into())
).into()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment