Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove generic with DynConnector #7

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -21,15 +21,12 @@ async fn main() -> Result<(), Error> {
Ok(())
}

async fn put_item<C>(
client: &Client<C>,
async fn put_item(
client: &Client,
table_name: &str,
request: Request,
_context: Context,
) -> Result<impl IntoResponse, Error>
where
C: aws_smithy_client::bounds::SmithyConnector,
{
) -> Result<impl IntoResponse, Error> {
// Extract path parameter from request
let path_parameters = request.path_parameters();
let id = match path_parameters.get("id") {
Expand Down Expand Up @@ -64,7 +61,7 @@ where
mod tests {
use super::*;
use aws_sdk_dynamodb::{Client, Config, Credentials, Region};
use aws_smithy_client::test_connection::TestConnection;
use aws_smithy_client::{erase::DynConnector, test_connection::TestConnection};
use aws_smithy_http::body::SdkBody;
use std::collections::HashMap;

Expand Down Expand Up @@ -103,7 +100,8 @@ mod tests {
))
.unwrap(),
)]);
let client = Client::from_conf_conn(get_mock_config().await, conn.clone());
let client =
Client::from_conf_conn(get_mock_config().await, DynConnector::new(conn.clone()));

let table_name = "test_table";

Expand Down