Skip to content

Commit 3c3a567

Browse files
authored
chore: stable fmt and clippy, set MSRV (#383)
1 parent a7e17ee commit 3c3a567

File tree

8 files changed

+46
-27
lines changed

8 files changed

+46
-27
lines changed

.github/workflows/build.yml

+21-20
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- ubuntu-latest
1313
- macOS-latest
1414
rust:
15+
- "1.54.0" # Current MSRV
1516
- stable
1617
- beta
1718
- nightly
@@ -21,24 +22,24 @@ jobs:
2122
include:
2223
- rust: nightly
2324
allow_failure: true
24-
exclude:
25-
- os: macOS-latest
26-
target: x86_64-unknown-linux-musl
27-
- os: ubuntu-latest
28-
rust: 1.40.0
29-
target: x86_64-unknown-linux-musl
30-
- os: ubuntu-latest
31-
rust: beta
32-
target: x86_64-unknown-linux-musl
33-
- os: ubuntu-latest
34-
rust: nightly
35-
target: x86_64-unknown-linux-musl
36-
- os: macOS-latest
37-
rust: 1.40.0
38-
- os: macOS-latest
39-
rust: beta
40-
- os: macOS-latest
41-
rust: nightly
25+
# exclude:
26+
# - os: macOS-latest
27+
# target: x86_64-unknown-linux-musl
28+
# - os: ubuntu-latest
29+
# rust: 1.40.0
30+
# target: x86_64-unknown-linux-musl
31+
# - os: ubuntu-latest
32+
# rust: beta
33+
# target: x86_64-unknown-linux-musl
34+
# - os: ubuntu-latest
35+
# rust: nightly
36+
# target: x86_64-unknown-linux-musl
37+
# - os: macOS-latest
38+
# rust: 1.40.0
39+
# - os: macOS-latest
40+
# rust: beta
41+
# - os: macOS-latest
42+
# rust: nightly
4243
env:
4344
RUST_BACKTRACE: 1
4445
steps:
@@ -63,7 +64,7 @@ jobs:
6364
- uses: actions/checkout@v1
6465
- uses: actions-rs/toolchain@v1
6566
with:
66-
toolchain: nightly
67+
toolchain: stable
6768
components: rustfmt
6869
override: true
6970
- name: Run fmt check
@@ -74,7 +75,7 @@ jobs:
7475
- uses: actions/checkout@v1
7576
- uses: actions-rs/toolchain@v1
7677
with:
77-
toolchain: nightly
78+
toolchain: stable
7879
components: clippy
7980
override: true
8081
- name: Run clippy check

.rustfmt.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
edition = "2018"
2-
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#merge_imports
3-
merge_imports = true
2+
# imports_granularity is unstable
3+
# # https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#merge_imports
4+
# imports_granularity = "Crate"
45
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#max_width
56
max_width = 120

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ INTEG_EXTENSIONS := extension-fn extension-trait
66
# Using musl to run extensions on both AL1 and AL2
77
INTEG_ARCH := x86_64-unknown-linux-musl
88

9+
pr-check:
10+
cargo +1.54.0 check --all
11+
cargo +stable fmt --all -- --check
12+
cargo +stable clippy
13+
914
integration-tests:
1015
# Build Integration functions
1116
cross build --release --target $(INTEG_ARCH) -p lambda_integration_tests

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,15 @@ fn main() -> Result<(), Box<Error>> {
259259
Ok(())
260260
}
261261
```
262+
263+
## Supported Rust Versions (MSRV)
264+
265+
The AWS Lambda Rust Runtime requires a minimum of Rust 1.54, and is not guaranteed to build on compiler versions earlier than that.
266+
267+
## Security
268+
269+
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
270+
271+
## License
272+
273+
This project is licensed under the Apache-2.0 License.

lambda-extension/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lambda_extension"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2018"
55
authors = ["David Calavera <[email protected]>"]
66
description = "AWS Lambda Extension API"
77
license = "Apache-2.0"

lambda-http/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub trait Handler<'a>: Sized {
103103
pub fn handler<'a, H: Handler<'a>>(handler: H) -> Adapter<'a, H> {
104104
Adapter {
105105
handler,
106-
_pd: PhantomData,
106+
_phantom_data: PhantomData,
107107
}
108108
}
109109

@@ -152,7 +152,7 @@ where
152152
/// for a larger explanation of why this is necessary
153153
pub struct Adapter<'a, H: Handler<'a>> {
154154
handler: H,
155-
_pd: PhantomData<&'a H>,
155+
_phantom_data: PhantomData<&'a H>,
156156
}
157157

158158
impl<'a, H: Handler<'a>> Handler<'a> for Adapter<'a, H> {

lambda-runtime-api-client/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lambda_runtime_api_client"
33
version = "0.4.1"
4-
edition = "2021"
4+
edition = "2018"
55
authors = ["David Calavera <[email protected]>"]
66
description = "AWS Lambda Runtime interaction API"
77
license = "Apache-2.0"

lambda-runtime-api-client/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use hyper::{
88
client::{connect::Connection, HttpConnector},
99
Body,
1010
};
11-
use std::fmt::Debug;
11+
use std::{convert::TryInto, fmt::Debug};
1212
use tokio::io::{AsyncRead, AsyncWrite};
1313
use tower_service::Service;
1414

0 commit comments

Comments
 (0)