Let the Android clippy run pass: two thread_locals it misreads
`cargo ndk ... clippy -p voelin-android -p voelin-ui -- -D warnings` stopped at missing_const_for_thread_local on the window's app state and the audio input buffer, which are both `const` already: on Android targets the macro expands so that clippy does not see the initializer. Allowed locally, with that reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ddc717a9f0
commit
39f5814d4a
2 files changed
+6
-1
No files matched your search
@@ -331,7 +331,9 @@ fn on_audio_input<'local>(
|
||||
channels: jint,
|
||||
) -> Result<jboolean> {
|
||||
thread_local! {
|
||||
// One per capture thread, reused for every call.
|
||||
// One per capture thread, reused for every call. (It is `const`;
|
||||
// clippy for Android does not see that through the expansion.)
|
||||
#[allow(clippy::missing_const_for_thread_local)]
|
||||
static BUFFER: std::cell::RefCell<Vec<f32>> = const { std::cell::RefCell::new(Vec::new()) };
|
||||
}
|
||||
let id = id as u64;
|
||||
|
||||
@@ -395,6 +395,9 @@ pub(crate) struct App {
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
// It is `const`; clippy for Android targets does not see that through
|
||||
// the macro's expansion there.
|
||||
#[allow(clippy::missing_const_for_thread_local)]
|
||||
static APP: RefCell<Option<App>> = const { RefCell::new(None) };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user