Skip to content

Commit e5770ce

Browse files
authored
chore: Enable the semicolon_inside_block lint (#2328)
This is what we mostly use in the code. Signed-off-by: Lars Eggert <[email protected]>
1 parent 5aee532 commit e5770ce

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pathbuf_init_then_push = "warn"
6666
redundant_type_annotations = "warn"
6767
ref_patterns = "warn"
6868
renamed_function_params = "warn"
69+
semicolon_inside_block = "warn"
6970
try_err = "warn"
7071
unneeded_field_pattern = "warn"
7172
unused_trait_names = "warn"

neqo-crypto/src/agent.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ impl SecretAgent {
337337
ssl::SSL_ImportFD(null_mut(), base_fd.cast())
338338
};
339339
if fd.is_null() {
340-
unsafe { prio::PR_Close(base_fd) };
340+
unsafe {
341+
prio::PR_Close(base_fd);
342+
}
341343
return Err(Error::CreateSslSocket);
342344
}
343345
Ok(fd)
@@ -758,11 +760,15 @@ impl SecretAgent {
758760
if self.raw == Some(true) {
759761
// Need to hold the record list in scope until the close is done.
760762
let _records = self.setup_raw().expect("Can only close");
761-
unsafe { prio::PR_Close(self.fd.cast()) };
763+
unsafe {
764+
prio::PR_Close(self.fd.cast());
765+
}
762766
} else {
763767
// Need to hold the IO wrapper in scope until the close is done.
764768
let _io = self.io.wrap(&[]);
765-
unsafe { prio::PR_Close(self.fd.cast()) };
769+
unsafe {
770+
prio::PR_Close(self.fd.cast());
771+
}
766772
};
767773
let _output = self.io.take_output();
768774
self.fd = null_mut();

0 commit comments

Comments
 (0)