diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..0a7dc64d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + tags: + - '*' + +jobs: + check_cargo_fmt: + name: Check that 'cargo fmt' has been run + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - run: cargo fmt --check + + check_cargo_clippy: + name: Check that 'cargo clippy' has no warnings + runs-on: ubuntu-22.04 + steps: + - run: sudo apt-get install pkg-config libssl-dev + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - run: cargo clippy --all-targets --all-features -- -Dwarnings diff --git a/src/tls_rustls/mod.rs b/src/tls_rustls/mod.rs index 6f5edae3..fabb983c 100644 --- a/src/tls_rustls/mod.rs +++ b/src/tls_rustls/mod.rs @@ -45,6 +45,7 @@ use tokio::{ use tokio_rustls::server::TlsStream; pub(crate) mod export { + #[allow(clippy::wildcard_imports)] use super::*; /// Create a tls server that will bind to provided address. @@ -301,8 +302,8 @@ fn config_from_pem(cert: Vec, key: Vec) -> io::Result { let mut key_vec: Vec> = rustls_pemfile::read_all(&mut key.as_ref()) .filter_map(|i| match i.ok()? { Item::Sec1Key(key) => Some(key.secret_sec1_der().to_vec()), - Item::Pkcs1Key(key) => Some(key.secret_pkcs1_der().to_vec().into()), - Item::Pkcs8Key(key) => Some(key.secret_pkcs8_der().to_vec().into()), + Item::Pkcs1Key(key) => Some(key.secret_pkcs1_der().to_vec()), + Item::Pkcs8Key(key) => Some(key.secret_pkcs8_der().to_vec()), _ => None, }) .collect();