Repository: awslabs/aws-lambda-rust-runtime (language: rust)

Issue:
Unable to use third party async libraries due to Sync requirements
Pull Request #284  Introduced the `Sync` requirement for all http lambdas.  

This broke any http lambdas using any of these libraries:
- Rusoto
- Mongodb
- Sqlx

### Reproduction
```rust
use lambda_http::{
    handler,
    lambda::{self, Context},
    IntoResponse, Request, RequestExt, Response,
};

use serde_json::{json, Value};
use rusoto_core::Region;
use rusoto_dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput};

type Error = Box<dyn std::error::Error + Send + Sync + 'static>;

#[tokio::main]
async fn main() -> Result<(), Error> {
    lambda::run(handler(func)).await?;
    Ok(())
}

async fn func(_: Request, _: Context) -> Result<Value, Error> {
    let client = DynamoDbClient::new(Region::UsEast1);

    let output = client.list_tables(Default::default()).await?;

    dbg!{output};

    Ok(json!({"success": true}))
}
```

```toml
[dependencies]
serde_json = "1.0"
serde = "1.0"
tokio = {version = "1.0", features = ["macros"]}

lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", branch = "master"}
lambda = { git = "https://github.com/awslabs/aws-lambda-rust-runtime/", branch = "master"}
rusoto_dynamodb = "0.46.0"
rusoto_core = "0.46.0"
```
This is the error I get:
```
error: future cannot be shared between threads safely
   --> src/main.rs:16:17
    |
16  |     lambda::run(handler(func)).await?;
    |                 ^^^^^^^ future returned by `func` is not `Sync`
    | 
   ::: ~/.cargo/git/checkouts/aws-lambda-rust-runtime-7c865cce90132439/9bd45c1/lambda-http/src/lib.rs:109:19
    |
109 | pub fn handler<H: Handler>(handler: H) -> Adapter<H> {
    |                   ------- required by this bound in `handler`
    |
    = help: the trait `Sync` is not implemented for `dyn Future<Output = std::result::Result<ListTablesOutput, RusotoError<ListTablesError>>> + Send`
note: future is not `Sync` as it awaits another future which is not `Sync`
   --> src/main.rs:23:18
    |
23  |     let output = client.list_tables(Default::default()).await?;
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `Pin<Box<dyn Future<Output = std::result::Result<ListTablesOutput, RusotoError<ListTablesError>>> + Send>>`, which is not `Sync`
```



Discussion / hints:
I'm looking into this. I'll get back to you when I have a solution.

Fix patch:
diff --git a/lambda-http/src/lib.rs b/lambda-http/src/lib.rs
index 91c8cd0d..7cff2b9a 100644
--- a/lambda-http/src/lib.rs
+++ b/lambda-http/src/lib.rs
@@ -100,7 +100,7 @@ pub trait Handler: Sized {
     /// The type of Response this Handler will return
     type Response: IntoResponse;
     /// The type of Future this Handler will return
-    type Fut: Future<Output = Result<Self::Response, Self::Error>> + Send + Sync + 'static;
+    type Fut: Future<Output = Result<Self::Response, Self::Error>> + Send + 'static;
     /// Function used to execute handler behavior
     fn call(&self, event: Request, context: Context) -> Self::Fut;
 }
@@ -115,7 +115,7 @@ impl<F, R, Fut> Handler for F
 where
     F: Fn(Request, Context) -> Fut,
     R: IntoResponse,
-    Fut: Future<Output = Result<R, Error>> + Send + Sync + 'static,
+    Fut: Future<Output = Result<R, Error>> + Send + 'static,
 {
     type Response = R;
     type Error = Error;
@@ -128,7 +128,7 @@ where
 #[doc(hidden)]
 pub struct TransformResponse<R, E> {
     request_origin: RequestOrigin,
-    fut: Pin<Box<dyn Future<Output = Result<R, E>> + Send + Sync>>,
+    fut: Pin<Box<dyn Future<Output = Result<R, E>> + Send>>,
 }
 
 impl<R, E> Future for TransformResponse<R, E>


Test patch: