Identifiable

This commit is contained in:
cdricms
2025-09-14 15:07:43 +02:00
parent b0e0b9792d
commit 85aa07ab7d

View File

@@ -206,12 +206,16 @@ public enum Unit: String, CaseIterable, CustomStringConvertible, Codable,
// but the internal `value` will be stored as a `Double`. // but the internal `value` will be stored as a `Double`.
public struct UnitValue<ValueType: ConvertibleToDouble>: public struct UnitValue<ValueType: ConvertibleToDouble>:
CustomStringConvertible, Equatable, CustomStringConvertible, Equatable,
Comparable, Codable Comparable, Codable, Identifiable
{ {
// Store the value internally as a Double for consistent calculations // Store the value internally as a Double for consistent calculations
public let value: Double public let value: Double
public let unit: Unit public let unit: Unit
public var id: String {
description
}
// MARK: Initialization // MARK: Initialization
/// Initializes UnitValue, converting the input value to Double. /// Initializes UnitValue, converting the input value to Double.
// MARK: Initialization // MARK: Initialization