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

chore: stable fmt and clippy, set MSRV #383

Merged
merged 1 commit into from
Dec 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- ubuntu-latest
- macOS-latest
rust:
- "1.54.0" # Current MSRV
- stable
- beta
- nightly
Expand All @@ -21,24 +22,24 @@ jobs:
include:
- rust: nightly
allow_failure: true
exclude:
- os: macOS-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
rust: 1.40.0
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
rust: beta
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
rust: nightly
target: x86_64-unknown-linux-musl
- os: macOS-latest
rust: 1.40.0
- os: macOS-latest
rust: beta
- os: macOS-latest
rust: nightly
# exclude:
# - os: macOS-latest
# target: x86_64-unknown-linux-musl
# - os: ubuntu-latest
# rust: 1.40.0
# target: x86_64-unknown-linux-musl
# - os: ubuntu-latest
# rust: beta
# target: x86_64-unknown-linux-musl
# - os: ubuntu-latest
# rust: nightly
# target: x86_64-unknown-linux-musl
# - os: macOS-latest
# rust: 1.40.0
# - os: macOS-latest
# rust: beta
# - os: macOS-latest
# rust: nightly
env:
RUST_BACKTRACE: 1
steps:
Expand All @@ -63,7 +64,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
components: rustfmt
override: true
- name: Run fmt check
Expand All @@ -74,7 +75,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
components: clippy
override: true
- name: Run clippy check
Expand Down
5 changes: 3 additions & 2 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
edition = "2018"
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#merge_imports
merge_imports = true
# imports_granularity is unstable
# # https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#merge_imports
# imports_granularity = "Crate"
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#max_width
max_width = 120
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ INTEG_EXTENSIONS := extension-fn extension-trait
# Using musl to run extensions on both AL1 and AL2
INTEG_ARCH := x86_64-unknown-linux-musl

pr-check:
cargo +1.54.0 check --all
cargo +stable fmt --all -- --check
cargo +stable clippy

integration-tests:
# Build Integration functions
cross build --release --target $(INTEG_ARCH) -p lambda_integration_tests
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,15 @@ fn main() -> Result<(), Box<Error>> {
Ok(())
}
```

## Supported Rust Versions (MSRV)

The AWS Lambda Rust Runtime requires a minimum of Rust 1.54, and is not guaranteed to build on compiler versions earlier than that.

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.

## License

This project is licensed under the Apache-2.0 License.
2 changes: 1 addition & 1 deletion lambda-extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lambda_extension"
version = "0.1.0"
edition = "2021"
edition = "2018"
authors = ["David Calavera <david.calavera@gmail.com>"]
description = "AWS Lambda Extension API"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions lambda-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub trait Handler<'a>: Sized {
pub fn handler<'a, H: Handler<'a>>(handler: H) -> Adapter<'a, H> {
Adapter {
handler,
_pd: PhantomData,
_phantom_data: PhantomData,
}
}

Expand Down Expand Up @@ -152,7 +152,7 @@ where
/// for a larger explanation of why this is necessary
pub struct Adapter<'a, H: Handler<'a>> {
handler: H,
_pd: PhantomData<&'a H>,
_phantom_data: PhantomData<&'a H>,
}

impl<'a, H: Handler<'a>> Handler<'a> for Adapter<'a, H> {
Expand Down
2 changes: 1 addition & 1 deletion lambda-runtime-api-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lambda_runtime_api_client"
version = "0.4.1"
edition = "2021"
edition = "2018"
authors = ["David Calavera <david.calavera@gmail.com>"]
description = "AWS Lambda Runtime interaction API"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion lambda-runtime-api-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use hyper::{
client::{connect::Connection, HttpConnector},
Body,
};
use std::fmt::Debug;
use std::{convert::TryInto, fmt::Debug};
use tokio::io::{AsyncRead, AsyncWrite};
use tower_service::Service;

Expand Down