rust/*: Fix warnings and errors
There were a couple of warnings about unused variables in `bt-battery`
and errors in `bt-common`.
Test: cargo build, cargo test
Change-Id: I768d6418945bd0019197865772fe80e0d2aa95cf
Reviewed-on: https://bluetooth-review.googlesource.com/c/bluetooth/+/2360
Reviewed-by: Marie Janssen <jamuraa@google.com>
Reviewed-by: Dayeong Lee <dayeonglee@google.com>
diff --git a/rust/bt-battery/src/monitor/client.rs b/rust/bt-battery/src/monitor/client.rs
index 04523d6..516cb72 100644
--- a/rust/bt-battery/src/monitor/client.rs
+++ b/rust/bt-battery/src/monitor/client.rs
@@ -105,13 +105,16 @@
/// connection to the peer.
_client: T::Client,
/// GATT client interface for interacting with the peer's battery service.
+ #[allow(unused)]
gatt_client: T::PeerService,
/// GATT Handles associated with the peer's one or more Battery Level
/// characteristics. The first `Handle` in this list is expected to be
/// the "primary" one.
// TODO(b/335259516): Save Handles for optional characteristics that are discovered.
+ #[allow(unused)]
battery_level_handles: Vec<Handle>,
/// The current battery level reported by the peer's battery server.
+ #[allow(unused)]
battery_level: BatteryLevel,
/// Collection of streams containing notifications from the peer's battery
/// characteristics.
diff --git a/rust/bt-common/src/uuids.rs b/rust/bt-common/src/uuids.rs
index ef8e3eb..53b544c 100644
--- a/rust/bt-common/src/uuids.rs
+++ b/rust/bt-common/src/uuids.rs
@@ -202,7 +202,7 @@
let uuid = Uuid::from_u16(0x180d);
assert_eq!(
uuid::Uuid::parse_str("0000180d-0000-1000-8000-00805f9b34fb").unwrap(),
- uuid.into()
+ uuid::Uuid::from(uuid),
);
// Should shorten the UUID16s
assert_eq!("0x180d", uuid.to_string());
@@ -215,7 +215,7 @@
let uuid = Uuid::from_u32(0xC0DECAFE);
assert_eq!(
uuid::Uuid::parse_str("c0decafe-0000-1000-8000-00805f9b34fb").unwrap(),
- uuid.into()
+ uuid::Uuid::from(uuid),
);
// Should shorten the UUID16s
assert_eq!("0xc0decafe", uuid.to_string());