Skip to content

Commit

Permalink
Fix BluetoothAddress conformance to Equatable
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 24, 2024
1 parent dc64de1 commit dfca731
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/Bluetooth/Address.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ public extension BluetoothAddress {
static var zero: BluetoothAddress { BluetoothAddress(bytes: (.zero, .zero, .zero, .zero, .zero, .zero)) }
}

// MARK: - Equatable

extension BluetoothAddress: Equatable {

public static func == (lhs: BluetoothAddress, rhs: BluetoothAddress) -> Bool {
return lhs.bytes.0 == rhs.bytes.0
&& lhs.bytes.1 == rhs.bytes.1
&& lhs.bytes.2 == rhs.bytes.2
&& lhs.bytes.3 == rhs.bytes.3
&& lhs.bytes.4 == rhs.bytes.4
&& lhs.bytes.5 == rhs.bytes.5
}
}

// MARK: - Hashable

extension BluetoothAddress: Hashable {
Expand Down

0 comments on commit dfca731

Please sign in to comment.