Skip to content

Commit 73b4614

Browse files
committed
clippy fixes
1 parent 8b9ab66 commit 73b4614

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

capi/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ pub struct PyStatus {
2929
pub exitcode: ffi::c_int,
3030
}
3131

32-
#[allow(clippy::missing_safety_doc)]
32+
/// # Safety
33+
/// err_msg and func are null.
3334
#[unsafe(export_name = "PyStatus_Ok")]
3435
pub unsafe extern "C" fn status_ok() -> PyStatus {
3536
PyStatus {
@@ -56,9 +57,10 @@ thread_local! {
5657
}
5758

5859
#[unsafe(export_name = "Py_Initialize")]
59-
pub unsafe extern "C" fn initialize() {
60+
pub extern "C" fn initialize() {
6061
// TODO: This sort of reimplemented what has already been done in the bin/lib crate, try reusing that.
6162
let settings = vm::Settings::default();
63+
#[allow(clippy::type_complexity)]
6264
let init_hooks: Vec<Box<dyn FnOnce(&mut vm::VirtualMachine)>> = vec![];
6365
let interp = vm::Interpreter::with_init(settings, |vm| {
6466
for hook in init_hooks {
@@ -74,12 +76,12 @@ pub unsafe extern "C" fn initialize() {
7476
}
7577

7678
#[unsafe(export_name = "Py_IsInitialized")]
77-
pub unsafe extern "C" fn is_initialized() -> i32 {
79+
pub extern "C" fn is_initialized() -> i32 {
7880
VM.with(|vm_ref| vm_ref.borrow().is_some() as i32)
7981
}
8082

8183
#[unsafe(export_name = "Py_Finalize")]
82-
pub unsafe extern "C" fn finalize() {
84+
pub extern "C" fn finalize() {
8385
VM.with(|vm_ref| {
8486
*vm_ref.borrow_mut() = None;
8587
});

0 commit comments

Comments
 (0)