summaryrefslogtreecommitdiff
path: root/cli/bench/http.rs
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-06-26 00:13:24 +0200
committerGitHub <noreply@github.com>2022-06-26 00:13:24 +0200
commit8d82ba729937baf83011354242cabc3d50c13dc2 (patch)
tree3e8c4d87986338639eeef4a76543e4335020262c /cli/bench/http.rs
parent38505db39137f33bfdb942658ea892a617ac0980 (diff)
build: require safety comments on unsafe code (#13870)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/bench/http.rs')
-rw-r--r--cli/bench/http.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/bench/http.rs b/cli/bench/http.rs
index 83f8eef8b..770642907 100644
--- a/cli/bench/http.rs
+++ b/cli/bench/http.rs
@@ -153,11 +153,13 @@ fn run(
fn get_port() -> u16 {
static mut NEXT_PORT: u16 = 4544;
- let port = unsafe { NEXT_PORT };
-
- unsafe {
+ // TODO(bartlomieju):
+ #[allow(clippy::undocumented_unsafe_blocks)]
+ let port = unsafe {
+ let p = NEXT_PORT;
NEXT_PORT += 1;
- }
+ p
+ };
port
}