Skip to content

Commit 514116d

Browse files
committed
copy the unsafe comment from the same pattern
1 parent d28f7b5 commit 514116d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

extensions/src/audio_ports_activation.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ mod host {
6363
match plugin.use_extension(&self.0).can_activate_while_processing {
6464
None => false,
6565
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()) }
7068
}
7169
}
7270
}
@@ -83,7 +81,7 @@ mod host {
8381
match plugin.use_extension(&self.0).set_active {
8482
None => false,
8583
Some(set_active) => {
86-
#[allow(clippy::undocumented_unsafe_blocks)]
84+
// SAFETY: This type ensures the function pointer is valid.
8785
unsafe {
8886
set_active(
8987
plugin.as_raw(),

extensions/src/param_indication.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ mod host {
8181
if let Some(set_mapping) = plugin.use_extension(&self.0).set_mapping {
8282
let label = CString::new(label).unwrap();
8383
let description = CString::new(description).unwrap();
84-
#[allow(clippy::undocumented_unsafe_blocks)]
84+
// SAFETY: This type ensures the function pointer is valid.
8585
unsafe {
8686
set_mapping(
8787
plugin.as_raw(),
@@ -104,7 +104,7 @@ mod host {
104104
color: clap_color,
105105
) {
106106
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.
108108
unsafe {
109109
set_automation(
110110
plugin.as_raw(),

0 commit comments

Comments
 (0)