Skip to content

Commit d927764

Browse files
committed
fix clippy warnings
1 parent 45b5b33 commit d927764

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

vm/src/stdlib/winreg.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use crate::{PyRef, VirtualMachine, builtins::PyModule};
55

66
pub(crate) fn make_module(vm: &VirtualMachine) -> PyRef<PyModule> {
7-
let module = winreg::make_module(vm);
8-
module
7+
winreg::make_module(vm)
98
}
109

1110
#[pymodule]
@@ -53,48 +52,55 @@ mod winreg {
5352
#[pyattr(once)]
5453
fn HKEY_CLASSES_ROOT(_vm: &VirtualMachine) -> PyHKEYObject {
5554
PyHKEYObject {
55+
#[allow(clippy::arc_with_non_send_sync)]
5656
hkey: Arc::new(PyRwLock::new(Registry::HKEY_CLASSES_ROOT)),
5757
}
5858
}
5959

6060
#[pyattr(once)]
6161
fn HKEY_CURRENT_USER(_vm: &VirtualMachine) -> PyHKEYObject {
6262
PyHKEYObject {
63+
#[allow(clippy::arc_with_non_send_sync)]
6364
hkey: Arc::new(PyRwLock::new(Registry::HKEY_CURRENT_USER)),
6465
}
6566
}
6667

6768
#[pyattr(once)]
6869
fn HKEY_LOCAL_MACHINE(_vm: &VirtualMachine) -> PyHKEYObject {
6970
PyHKEYObject {
71+
#[allow(clippy::arc_with_non_send_sync)]
7072
hkey: Arc::new(PyRwLock::new(Registry::HKEY_LOCAL_MACHINE)),
7173
}
7274
}
7375

7476
#[pyattr(once)]
7577
fn HKEY_USERS(_vm: &VirtualMachine) -> PyHKEYObject {
7678
PyHKEYObject {
79+
#[allow(clippy::arc_with_non_send_sync)]
7780
hkey: Arc::new(PyRwLock::new(Registry::HKEY_USERS)),
7881
}
7982
}
8083

8184
#[pyattr(once)]
8285
fn HKEY_PERFORMANCE_DATA(_vm: &VirtualMachine) -> PyHKEYObject {
8386
PyHKEYObject {
87+
#[allow(clippy::arc_with_non_send_sync)]
8488
hkey: Arc::new(PyRwLock::new(Registry::HKEY_PERFORMANCE_DATA)),
8589
}
8690
}
8791

8892
#[pyattr(once)]
8993
fn HKEY_CURRENT_CONFIG(_vm: &VirtualMachine) -> PyHKEYObject {
9094
PyHKEYObject {
95+
#[allow(clippy::arc_with_non_send_sync)]
9196
hkey: Arc::new(PyRwLock::new(Registry::HKEY_CURRENT_CONFIG)),
9297
}
9398
}
9499

95100
#[pyattr(once)]
96101
fn HKEY_DYN_DATA(_vm: &VirtualMachine) -> PyHKEYObject {
97102
PyHKEYObject {
103+
#[allow(clippy::arc_with_non_send_sync)]
98104
hkey: Arc::new(PyRwLock::new(Registry::HKEY_DYN_DATA)),
99105
}
100106
}
@@ -825,14 +831,14 @@ mod winreg {
825831
}
826832
// REG_SZ is fallthrough
827833
REG_EXPAND_SZ => {
828-
return Err(vm.new_type_error(
834+
Err(vm.new_type_error(
829835
"TODO: RUSTPYTHON REG_EXPAND_SZ is not supported".to_string(),
830-
));
836+
))
831837
}
832838
REG_MULTI_SZ => {
833-
return Err(
839+
Err(
834840
vm.new_type_error("TODO: RUSTPYTHON REG_MULTI_SZ is not supported".to_string())
835-
);
841+
)
836842
}
837843
// REG_BINARY is fallthrough
838844
_ => {

0 commit comments

Comments
 (0)