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

ci: run clippy on all features #4809

Merged
merged 2 commits into from
Sep 30, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/ci_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ jobs:
- name: Run cargo clippy
run: |
cargo clippy --manifest-path ${{env.ROOT_PATH}}/Cargo.toml --all-targets -- -D warnings
jmayclin marked this conversation as resolved.
Show resolved Hide resolved
cargo clippy --manifest-path ${{env.ROOT_PATH}}/Cargo.toml --all-targets --all-features -- -D warnings

msrv:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions bindings/rust/s2n-tls/src/client_hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ impl fmt::Debug for ClientHello {
}
}

// Leftover from when fingerprinting was implemented in this module
#[cfg(feature = "unstable-fingerprint")]
pub use crate::fingerprint::FingerprintType;

#[cfg(test)]
mod tests {
use crate::client_hello::ClientHello;
Expand Down Expand Up @@ -177,7 +181,3 @@ mod tests {
assert_eq!("incoming.telemetry.mozilla.org".as_bytes(), server_name);
}
}

// Leftover from when fingerprinting was implemented in this module
#[cfg(feature = "unstable-fingerprint")]
pub use crate::fingerprint::FingerprintType;
6 changes: 3 additions & 3 deletions bindings/rust/s2n-tls/src/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ mod tests {
};
use std::{collections::HashSet, error::Error};

const CLIENT_HELLO_BYTES: &'static [u8] = &[
const CLIENT_HELLO_BYTES: &[u8] = &[
0x01, 0x00, 0x00, 0xEC, 0x03, 0x03, 0x90, 0xe8, 0xcc, 0xee, 0xe5, 0x70, 0xa2, 0xa1, 0x2f,
0x6b, 0x69, 0xd2, 0x66, 0x96, 0x0f, 0xcf, 0x20, 0xd5, 0x32, 0x6e, 0xc4, 0xb2, 0x8c, 0xc7,
0xbd, 0x0a, 0x06, 0xc2, 0xa5, 0x14, 0xfc, 0x34, 0x20, 0xaf, 0x72, 0xbf, 0x39, 0x99, 0xfb,
Expand Down Expand Up @@ -398,7 +398,7 @@ mod tests {
let client_hello = pair.server.client_hello()?;

let mut builder = Fingerprint::builder(FingerprintType::JA3)?;
let mut fingerprint = builder.build(&client_hello)?;
let mut fingerprint = builder.build(client_hello)?;

let hash_size = fingerprint.hash_size()?;
let hash = fingerprint.hash()?;
Expand Down Expand Up @@ -498,7 +498,7 @@ mod tests {
pair.handshake()?;

let client_hello = pair.server.client_hello()?;
let mut fingerprint = builder.build(&client_hello)?;
let mut fingerprint = builder.build(client_hello)?;

let hash = fingerprint.hash()?;
hex::decode(hash)?;
Expand Down
12 changes: 6 additions & 6 deletions bindings/rust/s2n-tls/src/renegotiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl config::Builder {
return CallbackResult::Success.into();
}
}
return CallbackResult::Failure.into();
CallbackResult::Failure.into()
})
}

Expand Down Expand Up @@ -311,7 +311,7 @@ mod tests {
// Like s2n-tls, a call to send / write is required.
let to_send = [0; 1];
self.server
.write(&to_send)
.write_all(&to_send)
.expect("Failed to write hello request");

// s2n-tls needs to attempt to read data to receive the message
Expand All @@ -328,7 +328,7 @@ mod tests {
self.server.write_all(&to_send)?;
unwrap_poll(self.client.poll_recv(&mut recv_buffer))?;
unwrap_poll(self.client.poll_send(&to_send))?;
self.server.read(&mut recv_buffer)?;
self.server.read_exact(&mut recv_buffer)?;
Ok(())
}

Expand Down Expand Up @@ -447,7 +447,7 @@ mod tests {
let to_write = "hello world";
let mut buf = [0; 100];
pair.server
.write(to_write.as_bytes())
.write_all(to_write.as_bytes())
.expect("Application data during renegotiate");
let (result, n) = pair.client.poll_renegotiate(&mut buf);
assert!(result.is_pending());
Expand Down Expand Up @@ -489,7 +489,7 @@ mod tests {
if this.count > 1 {
// Repeatedly block the handshake in order to verify
// that renegotiate can handle Pending callbacks.
this.count = this.count - 1;
this.count -= 1;
Pending
} else {
// Perform the pkey operation with the selected cert / key pair.
Expand Down Expand Up @@ -568,7 +568,7 @@ mod tests {
if this.count > 1 {
// Repeatedly block the handshake in order to verify
// that renegotiate can handle Pending callbacks.
this.count = this.count - 1;
this.count -= 1;
Pending
} else {
conn.set_server_name(&this.server_name)?;
Expand Down
Loading