File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,8 @@ mod host {
63
63
match plugin. use_extension ( & self . 0 ) . can_activate_while_processing {
64
64
None => false ,
65
65
Some ( can_activate_while_processing) => {
66
- #[ allow( clippy:: undocumented_unsafe_blocks) ]
67
- unsafe {
68
- can_activate_while_processing ( plugin. as_raw ( ) )
69
- }
66
+ // SAFETY: This type ensures the function pointer is valid.
67
+ unsafe { can_activate_while_processing ( plugin. as_raw ( ) ) }
70
68
}
71
69
}
72
70
}
@@ -83,7 +81,7 @@ mod host {
83
81
match plugin. use_extension ( & self . 0 ) . set_active {
84
82
None => false ,
85
83
Some ( set_active) => {
86
- # [ allow ( clippy :: undocumented_unsafe_blocks ) ]
84
+ // SAFETY: This type ensures the function pointer is valid.
87
85
unsafe {
88
86
set_active (
89
87
plugin. as_raw ( ) ,
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ mod host {
81
81
if let Some ( set_mapping) = plugin. use_extension ( & self . 0 ) . set_mapping {
82
82
let label = CString :: new ( label) . unwrap ( ) ;
83
83
let description = CString :: new ( description) . unwrap ( ) ;
84
- # [ allow ( clippy :: undocumented_unsafe_blocks ) ]
84
+ // SAFETY: This type ensures the function pointer is valid.
85
85
unsafe {
86
86
set_mapping (
87
87
plugin. as_raw ( ) ,
@@ -104,7 +104,7 @@ mod host {
104
104
color : clap_color ,
105
105
) {
106
106
if let Some ( set_automation) = plugin. use_extension ( & self . 0 ) . set_automation {
107
- # [ allow ( clippy :: undocumented_unsafe_blocks ) ]
107
+ // SAFETY: This type ensures the function pointer is valid.
108
108
unsafe {
109
109
set_automation (
110
110
plugin. as_raw ( ) ,
You can’t perform that action at this time.
0 commit comments