Skip to content

Commit

Permalink
Fix remaining tests and clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Veetaha committed Sep 2, 2021
1 parent 8c284b5 commit aaefb3a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions dynomite/examples/lambda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ use dynomite::{
retry::Policy,
Retries,
};
use lambda_http::{handler, lambda};
use lambda_http::{handler, lambda_runtime};

type Error = Box<dyn std::error::Error + Send + Sync + 'static>;

#[tokio::main]
async fn main() -> Result<(), Error> {
let client = DynamoDbClient::new(Default::default()).with_retries(Policy::default());

lambda::run(handler(move |_, _| {
lambda_runtime::run(handler(move |_, _| {
let client = client.clone();
async move {
let tables = client
Expand All @@ -21,8 +21,7 @@ async fn main() -> Result<(), Error> {
.unwrap_or_default();
Ok::<_, Error>(tables.join("\n"))
}
}))
.await?;
})).await?;

Ok(())
}
2 changes: 1 addition & 1 deletion dynomite/tests/integration/derived.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ mod tests {
#[derive(Attribute, Debug, PartialEq)]
enum Foo {
Bar,
};
}
assert_eq!(Foo::Bar, Foo::from_attr(Foo::Bar.into_attr()).unwrap());
}

Expand Down
4 changes: 1 addition & 3 deletions dynomite/trybuild-tests/fail/item-not-on-struct-fail.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use dynomite_derive::Item;

fn main() {

fail();

}

#[derive(Item)]
#[derive(dynomite_derive::Item)]
fn fail() {
println!("This should fail");
}
6 changes: 3 additions & 3 deletions dynomite/trybuild-tests/fail/item-not-on-struct-fail.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0774]: `derive` may only be applied to structs, enums and unions
--> $DIR/item-not-on-struct-fail.rs:9:1
--> $DIR/item-not-on-struct-fail.rs:7:1
|
9 | #[derive(Item)]
| ^^^^^^^^^^^^^^^
7 | #[derive(dynomite_derive::Item)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 comments on commit aaefb3a

Please sign in to comment.