Skip to content

Commit 1d2455c

Browse files
committed
chore: Remove unused variables from release compilation target
1 parent 2886adf commit 1d2455c

9 files changed

+156
-172
lines changed

.direnv/flake-profile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
flake-profile-9-link
1+
flake-profile-10-link

.direnv/flake-profile-10-link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nix/store/k8q5dfbwf9kdkfjl53772smjjrpirl2s-nix-shell-env

.direnv/flake-profile-9-link

-1
This file was deleted.

flake.nix

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@
3434
devShells.default = pkgs.mkShell {
3535
inputsFrom = builtins.attrValues self'.packages;
3636
packages = with pkgs; [
37-
# (rust-bin.selectLatestNightlyWith
38-
# (toolchain: toolchain.default))
39-
rust-bin.nightly."2024-05-08".minimal
37+
(rust-bin.selectLatestNightlyWith
38+
(toolchain: toolchain.default))
4039
rust-analyzer
4140
clippy
4241
];

src/bluetooth/bluetooth_manager.rs

+40-40
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ fn get_objects() -> HashMap<Path<'static>, HashMap<String, PropMap>> {
6767
1000,
6868
(HashMap<Path<'static>, HashMap<String, PropMap>>,),
6969
);
70-
if let Err(error) = res {
70+
if let Err(_error) = res {
7171
ERROR!(
72-
format!("Could not to get bluetooth objects {}", error),
72+
format!("Could not to get bluetooth objects {}", _error),
7373
ErrorLevel::PartialBreakage
7474
);
7575
return HashMap::new();
@@ -275,19 +275,19 @@ impl BluetoothInterface {
275275
)
276276
.append1(device);
277277
let res = added_ref.send(msg);
278-
if let Err(error) = res {
278+
if let Err(_error) = res {
279279
ERROR!(
280-
format!("Could not send signal: {:?}", error),
280+
format!("Could not send signal: {:?}", _error),
281281
ErrorLevel::PartialBreakage
282282
);
283283
}
284284
}
285285
true
286286
},
287287
);
288-
if let Err(error) = res {
288+
if let Err(_error) = res {
289289
ERROR!(
290-
format!("Failed to match signal on bluez {:?}", error),
290+
format!("Failed to match signal on bluez {:?}", _error),
291291
ErrorLevel::Critical
292292
);
293293
return Err(dbus::Error::new_custom(
@@ -305,18 +305,18 @@ impl BluetoothInterface {
305305
)
306306
.append1(ir.object);
307307
let res = removed_ref.send(msg);
308-
if let Err(error) = res {
308+
if let Err(_error) = res {
309309
ERROR!(
310-
format!("Could not send signal {:?}", error),
310+
format!("Could not send signal {:?}", _error),
311311
ErrorLevel::PartialBreakage
312312
);
313313
}
314314
true
315315
},
316316
);
317-
if let Err(error) = res {
317+
if let Err(_error) = res {
318318
ERROR!(
319-
format!("Failed to match signal on bluez {:?}", error),
319+
format!("Failed to match signal on bluez {:?}", _error),
320320
ErrorLevel::Critical
321321
);
322322
return Err(dbus::Error::new_custom(
@@ -346,9 +346,9 @@ impl BluetoothInterface {
346346
)
347347
.append1(device);
348348
let res = changed_ref.clone().send(msg);
349-
if let Err(error) = res {
349+
if let Err(_error) = res {
350350
ERROR!(
351-
format!("Could not send signal: {:?}", error),
351+
format!("Could not send signal: {:?}", _error),
352352
ErrorLevel::PartialBreakage
353353
);
354354
}
@@ -361,9 +361,9 @@ impl BluetoothInterface {
361361
}
362362
},
363363
);
364-
if let Err(error) = res {
364+
if let Err(_error) = res {
365365
ERROR!(
366-
format!("Failed to match signal on bluez: {:?}", error),
366+
format!("Failed to match signal on bluez: {:?}", _error),
367367
ErrorLevel::Critical
368368
);
369369
return Err(dbus::Error::new_custom(
@@ -389,9 +389,9 @@ impl BluetoothInterface {
389389
stop_requested.store(false, Ordering::SeqCst);
390390
let res: Result<(), dbus::Error> =
391391
proxy.method_call(BLUEZ_ADAPTER_INTERFACE!(), "StopDiscovery", ());
392-
if let Err(error) = res {
392+
if let Err(_error) = res {
393393
ERROR!(
394-
format!("Failed to stop bluetooth discovery: {:?}", error),
394+
format!("Failed to stop bluetooth discovery: {:?}", _error),
395395
ErrorLevel::Critical
396396
);
397397
} else {
@@ -403,9 +403,9 @@ impl BluetoothInterface {
403403
scan_request.store(0, Ordering::SeqCst);
404404
let res: Result<(), dbus::Error> =
405405
proxy.method_call(BLUEZ_ADAPTER_INTERFACE!(), "StartDiscovery", ());
406-
if let Err(error) = res {
406+
if let Err(_error) = res {
407407
ERROR!(
408-
format!("Failed to start bluetooth discovery: {:?}", error),
408+
format!("Failed to start bluetooth discovery: {:?}", _error),
409409
ErrorLevel::Critical
410410
);
411411
} else {
@@ -415,9 +415,9 @@ impl BluetoothInterface {
415415
scan_request.store(0, Ordering::SeqCst);
416416
let res: Result<(), dbus::Error> =
417417
proxy.method_call(BLUEZ_ADAPTER_INTERFACE!(), "StopDiscovery", ());
418-
if let Err(error) = res {
418+
if let Err(_error) = res {
419419
ERROR!(
420-
format!("Failed to stop bluetooth discovery: {:?}", error),
420+
format!("Failed to stop bluetooth discovery: {:?}", _error),
421421
ErrorLevel::Critical
422422
);
423423
} else {
@@ -441,11 +441,11 @@ impl BluetoothInterface {
441441
10000,
442442
(),
443443
);
444-
if let Err(error) = res {
444+
if let Err(_error) = res {
445445
ERROR!(
446446
format!(
447447
"Failed to connect to bluetooth device: {} with error: {}",
448-
device, error
448+
device, _error
449449
),
450450
ErrorLevel::Critical
451451
);
@@ -467,11 +467,11 @@ impl BluetoothInterface {
467467
10000,
468468
(),
469469
);
470-
if let Err(error) = res {
470+
if let Err(_error) = res {
471471
ERROR!(
472472
format!(
473473
"Failed to pair with bluetooth device: {} with error {}",
474-
device, error
474+
device, _error
475475
),
476476
ErrorLevel::Critical
477477
);
@@ -504,9 +504,9 @@ impl BluetoothInterface {
504504
1000,
505505
(),
506506
);
507-
if let Err(error) = res {
507+
if let Err(_error) = res {
508508
ERROR!(
509-
format!("Failed to register bluetooth agent: {}", error),
509+
format!("Failed to register bluetooth agent: {}", _error),
510510
ErrorLevel::PartialBreakage
511511
);
512512
return false;
@@ -528,9 +528,9 @@ impl BluetoothInterface {
528528
1000,
529529
(Path<'static>,),
530530
);
531-
if let Err(error) = res {
531+
if let Err(_error) = res {
532532
ERROR!(
533-
format!("Failed to unregister bluetooth agent {}", error),
533+
format!("Failed to unregister bluetooth agent {}", _error),
534534
ErrorLevel::PartialBreakage
535535
);
536536
return false;
@@ -553,9 +553,9 @@ impl BluetoothInterface {
553553
1000,
554554
(),
555555
);
556-
if let Err(error) = res {
556+
if let Err(_error) = res {
557557
ERROR!(
558-
format!("Failed to start bluetooth discovery: {}", error),
558+
format!("Failed to start bluetooth discovery: {}", _error),
559559
ErrorLevel::PartialBreakage
560560
);
561561
} else {
@@ -573,9 +573,9 @@ impl BluetoothInterface {
573573
1000,
574574
(),
575575
);
576-
if let Err(error) = res {
576+
if let Err(_error) = res {
577577
ERROR!(
578-
format!("Could not stop bluetooth discovery {}", error),
578+
format!("Could not stop bluetooth discovery {}", _error),
579579
ErrorLevel::PartialBreakage
580580
);
581581
} else {
@@ -606,11 +606,11 @@ fn get_bluetooth_device_properties(path: &Path<'static>) -> PropMap {
606606
1000,
607607
(PropMap,),
608608
);
609-
if let Err(error) = res {
609+
if let Err(_error) = res {
610610
ERROR!(
611611
format!(
612612
"Failed to get properties of bluetooth device: {} with error: {}",
613-
path, error
613+
path, _error
614614
),
615615
ErrorLevel::Recoverable
616616
);
@@ -627,11 +627,11 @@ pub fn set_adapter_enabled(path: Path<'static>, enabled: bool) -> bool {
627627
"Powered",
628628
enabled,
629629
);
630-
if let Err(error) = res {
630+
if let Err(_error) = res {
631631
ERROR!(
632632
format!(
633633
"Failed to set enabled mode on bluetooth adapter {} to: {} with error: {}",
634-
path, enabled, error
634+
path, enabled, _error
635635
),
636636
ErrorLevel::Recoverable
637637
);
@@ -648,11 +648,11 @@ pub fn set_adapter_discoverable(path: Path<'static>, enabled: bool) -> bool {
648648
"Discoverable",
649649
enabled,
650650
);
651-
if let Err(error) = res {
651+
if let Err(_error) = res {
652652
ERROR!(
653653
format!(
654654
"Failed to set discoverability mode on bluetooth adapter {} to: {} with error: {}",
655-
path, enabled, error
655+
path, enabled, _error
656656
),
657657
ErrorLevel::Recoverable
658658
);
@@ -669,11 +669,11 @@ pub fn set_adapter_pairable(path: Path<'static>, enabled: bool) -> bool {
669669
"Pairable",
670670
enabled,
671671
);
672-
if let Err(error) = res {
672+
if let Err(_error) = res {
673673
ERROR!(
674674
format!(
675675
"Failed to set pairability mode on bluetooth adapter {} to: {} with error: {}",
676-
path, enabled, error
676+
path, enabled, _error
677677
),
678678
ErrorLevel::Recoverable
679679
);

src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ pub async fn run_daemon(ready: Option<Arc<AtomicBool>>) {
7676
*PLUGIN_DIR = PathBuf::from(path);
7777
}
7878
}
79-
re_set_lib::utils::flags::Flag::Other(_) => {
80-
LOG!("Custom flag");
79+
re_set_lib::utils::flags::Flag::Other(_flag) => {
80+
LOG!(format!(
81+
"Custom flag {} with value {:#?}",
82+
&_flag.0,
83+
_flag.1.clone()
84+
));
8185
// currently no other flags are supported or used, but might be used in plugins
8286
}
8387
}

0 commit comments

Comments
 (0)