Skip to content

Commit 3e46e3b

Browse files
JSKittyclaude
andcommitted
fix: suppress 11 warnings on macOS and Android release builds
Variables only used inside cfg(debug_assertions) log macros appear unused in release builds. Prefix with _ and remove unused std::path::Path import. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 79657b7 commit 3e46e3b

4 files changed

Lines changed: 23 additions & 25 deletions

File tree

src-tauri/src/android/miniapp_jni.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use jni::objects::{JByteArray, JClass, JString};
88
use jni::sys::{jint, jstring, jobject};
99
use jni::JNIEnv;
1010
use std::io::Read;
11-
use std::path::Path;
1211
use tauri::{Emitter, Manager};
1312
use crate::util::bytes_to_hex_string;
1413
use crate::TAURI_APP;
@@ -46,23 +45,23 @@ pub extern "C" fn Java_io_vectorapp_miniapp_MiniAppManager_onMiniAppOpened(
4645
chat_id: JString,
4746
message_id: JString,
4847
) {
49-
let miniapp_id: String = match env.get_string(&miniapp_id) {
48+
let _miniapp_id: String = match env.get_string(&miniapp_id) {
5049
Ok(s) => s.into(),
5150
Err(e) => {
5251
log_error!("Failed to get miniapp_id: {:?}", e);
5352
return;
5453
}
5554
};
5655

57-
let chat_id: String = match env.get_string(&chat_id) {
56+
let _chat_id: String = match env.get_string(&chat_id) {
5857
Ok(s) => s.into(),
5958
Err(e) => {
6059
log_error!("Failed to get chat_id: {:?}", e);
6160
return;
6261
}
6362
};
6463

65-
let message_id: String = match env.get_string(&message_id) {
64+
let _message_id: String = match env.get_string(&message_id) {
6665
Ok(s) => s.into(),
6766
Err(e) => {
6867
log_error!("Failed to get message_id: {:?}", e);
@@ -72,7 +71,7 @@ pub extern "C" fn Java_io_vectorapp_miniapp_MiniAppManager_onMiniAppOpened(
7271

7372
log_info!(
7473
"Mini App opened (JNI callback): {} (chat: {}, message: {})",
75-
miniapp_id, chat_id, message_id
74+
_miniapp_id, _chat_id, _message_id
7675
);
7776

7877
// TODO: Update state tracking if needed
@@ -181,12 +180,12 @@ pub extern "C" fn Java_io_vectorapp_miniapp_MiniAppIpc_invokeNative(
181180
Err(e) => return create_error_string(&mut env, &format!("Failed to get command: {:?}", e)),
182181
};
183182

184-
let args: String = match env.get_string(&args) {
183+
let _args: String = match env.get_string(&args) {
185184
Ok(s) => s.into(),
186185
Err(e) => return create_error_string(&mut env, &format!("Failed to get args: {:?}", e)),
187186
};
188187

189-
log_debug!("[{}] invokeNative: {} (args: {})", miniapp_id, command, args);
188+
log_debug!("[{}] invokeNative: {} (args: {})", miniapp_id, command, _args);
190189

191190
// Route to appropriate handler
192191
let result = match command.as_str() {
@@ -221,23 +220,23 @@ pub extern "C" fn Java_io_vectorapp_miniapp_MiniAppIpc_sendUpdateNative(
221220
update: JString,
222221
description: JString,
223222
) {
224-
let miniapp_id: String = match env.get_string(&miniapp_id) {
223+
let _miniapp_id: String = match env.get_string(&miniapp_id) {
225224
Ok(s) => s.into(),
226225
Err(e) => {
227226
log_error!("Failed to get miniapp_id: {:?}", e);
228227
return;
229228
}
230229
};
231230

232-
let update: String = match env.get_string(&update) {
231+
let _update: String = match env.get_string(&update) {
233232
Ok(s) => s.into(),
234233
Err(e) => {
235234
log_error!("Failed to get update: {:?}", e);
236235
return;
237236
}
238237
};
239238

240-
let description: String = match env.get_string(&description) {
239+
let _description: String = match env.get_string(&description) {
241240
Ok(s) => s.into(),
242241
Err(e) => {
243242
log_error!("Failed to get description: {:?}", e);
@@ -247,7 +246,7 @@ pub extern "C" fn Java_io_vectorapp_miniapp_MiniAppIpc_sendUpdateNative(
247246

248247
log_info!(
249248
"[{}] sendUpdate: {} ({})",
250-
miniapp_id, description, update
249+
_miniapp_id, _description, _update
251250
);
252251

253252
// TODO: Store update and broadcast to other participants
@@ -259,16 +258,16 @@ pub extern "C" fn Java_io_vectorapp_miniapp_MiniAppIpc_getUpdatesNative(
259258
mut env: JNIEnv,
260259
_class: JClass,
261260
miniapp_id: JString,
262-
last_known_serial: jint,
261+
_last_known_serial: jint,
263262
) -> jstring {
264-
let miniapp_id: String = match env.get_string(&miniapp_id) {
263+
let _miniapp_id: String = match env.get_string(&miniapp_id) {
265264
Ok(s) => s.into(),
266265
Err(e) => return create_error_string(&mut env, &format!("Failed to get miniapp_id: {:?}", e)),
267266
};
268267

269268
log_debug!(
270269
"[{}] getUpdates since serial: {}",
271-
miniapp_id, last_known_serial
270+
_miniapp_id, _last_known_serial
272271
);
273272

274273
// TODO: Implement actual update retrieval

src-tauri/src/miniapps/marketplace.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,9 @@ async fn recache_miniapp_icon<R: Runtime>(
527527
icon_url: &str,
528528
) {
529529
// Remove old cached icon first to force re-download
530-
if let Err(e) = image_cache::remove_cached_image(handle, icon_url, ImageType::MiniAppIcon) {
530+
if let Err(_e) = image_cache::remove_cached_image(handle, icon_url, ImageType::MiniAppIcon) {
531531
// Log but don't fail - the old cache might not exist
532-
log_info!("[Marketplace] Could not remove old icon cache for {}: {}", app_id, e);
532+
log_info!("[Marketplace] Could not remove old icon cache for {}: {}", app_id, _e);
533533
}
534534

535535
// Now cache the (potentially new) icon
@@ -916,9 +916,9 @@ pub async fn publish_to_marketplace<T: NostrSigner + Clone>(
916916
log_info!("Uploaded icon to Blossom: {} ({})", url, mime_type);
917917
Some((url, mime_type))
918918
}
919-
Err(e) => {
919+
Err(_e) => {
920920
// Log warning but continue without icon
921-
log_info!("Warning: Failed to upload icon: {}. Continuing without icon.", e);
921+
log_info!("Warning: Failed to upload icon: {}. Continuing without icon.", _e);
922922
None
923923
}
924924
}

src-tauri/src/miniapps/realtime.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ impl IrohState {
336336
self.endpoint.add_node_addr(peer.clone())?;
337337

338338
// Verify the node address was added by checking if we can get connection info
339-
if let Some(info) = self.endpoint.remote_info(peer.node_id) {
339+
if let Some(_info) = self.endpoint.remote_info(peer.node_id) {
340340
log_trace!("[WEBXDC] add_peer: Remote info for peer {}: relay_url={:?}, addrs={:?}",
341341
peer.node_id,
342-
info.relay_url,
343-
info.addrs);
342+
_info.relay_url,
343+
_info.addrs);
344344
} else {
345345
log_trace!("[WEBXDC] add_peer: WARNING - Could not get remote info for peer {}", peer.node_id);
346346
}

src-tauri/src/miniapps/state.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,14 @@ impl MiniAppsState {
324324
let mut pending = self.pending_peers.write().await;
325325

326326
// Remove expired peers from each topic
327-
pending.retain(|topic, peers| {
327+
pending.retain(|_topic, peers| {
328328
let before_count = peers.len();
329329
peers.retain(|p| now.duration_since(p.received_at).as_secs() < 300);
330330
let after_count = peers.len();
331-
331+
332332
if before_count != after_count {
333-
let topic_encoded = crate::miniapps::realtime::encode_topic_id(topic);
334333
log_debug!("[WEBXDC] Cleaned up {} expired peers for topic {}",
335-
before_count - after_count, topic_encoded);
334+
before_count - after_count, crate::miniapps::realtime::encode_topic_id(_topic));
336335
}
337336

338337
// Keep the topic entry only if it still has peers

0 commit comments

Comments
 (0)