Skip to content

Commit

Permalink
refactor(backend): remove Copy trait
Browse files Browse the repository at this point in the history
From `BluetoothAddress`.

Follow Rust API guidelines and do not add Copy unless there is a good reason to do so.
  • Loading branch information
SARDONYX-sard committed May 20, 2023
1 parent 7c0fc9c commit 12ffec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/bluetooth/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl Display for BluetoothClass {
}

/// Network byte order(Big endian) u64
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct BluetoothAddress(u64);

pub enum ByteOrder {
Expand All @@ -153,7 +153,7 @@ impl BluetoothAddress {
///
/// e.g. [0xcc, 0xbb, 0xaa, 0x22, 0x11, 0x00] => "00:11:22:aa:bb:cc"
pub fn as_hex_string_with_colon(&self, byte_order: ByteOrder) -> String {
let rg_bytes: [u8; 6] = (*self).into();
let rg_bytes: [u8; 6] = (*self).clone().into();
match byte_order {
ByteOrder::BigEndian => format!(
"{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}",
Expand Down

0 comments on commit 12ffec7

Please sign in to comment.