Skip to content

Commit

Permalink
Deny undocumented unsafe blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Aug 9, 2024
1 parent 6305b23 commit 277985e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ categories = ["game-development", "network-programming"]
edition.workspace = true
exclude = ["docs", "build", "examples", "image"]

[lints]
workspace = true

[[bench]]
name = "read_write"
harness = false
Expand Down Expand Up @@ -227,3 +230,6 @@ fixedstr = { version = "0.5", features = ["flex-str"] }
parking_lot = "0.12.1"
schemars = { version = "0.8.15", features = ["bytes", "url"] }
url = { version = "2.4.1", features = ["serde"] }

[workspace.lints.clippy]
undocumented_unsafe_blocks = "deny"
3 changes: 3 additions & 0 deletions crates/agones/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ license = "Apache-2.0"
description = "End to end integration tests to be run against a Kubernetes cluster with Agones installed"
readme = "README.md"

[lints]
workspace = true

[dependencies]
base64.workspace = true
futures.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ edition = "2018"
[lib]
proc-macro = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lints]
workspace = true

[dependencies]
proc-macro2 = "1.0.58"
Expand Down
3 changes: 2 additions & 1 deletion crates/quilkin-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lints]
workspace = true

[dependencies]
prost.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ version = "0.1.0"
edition = "2021"
publish = false

[lints]
workspace = true

[dependencies]
async-channel.workspace = true
once_cell.workspace = true
Expand Down
1 change: 1 addition & 0 deletions src/components/proxy/io_uring_shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ mod test {
/// triggers the completion of the I/O request
#[test]
#[cfg(target_os = "linux")]
#[allow(clippy::undocumented_unsafe_blocks)]
fn eventfd_works_as_expected() {
let mut event = EventFd::new().unwrap();
let event_writer = event.writer();
Expand Down
1 change: 1 addition & 0 deletions src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ mod test {
let mut asn = [0u8; 10];
let len = super::itoa(num, &mut asn);

// SAFETY: itoa only writes ASCII
let asn_str = unsafe { std::str::from_utf8_unchecked(&asn[..len as _]) };

assert_eq!(asn_str, exp);
Expand Down

0 comments on commit 277985e

Please sign in to comment.