mirror of
https://github.com/yattee/yattee.git
synced 2025-10-10 17:38:15 +00:00
Use Swift 5.7 if-let style
This commit is contained in:
@@ -55,7 +55,7 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
||||
var formats: [Format]
|
||||
|
||||
var description: String {
|
||||
if let name = name, !name.isEmpty { return name }
|
||||
if let name, !name.isEmpty { return name }
|
||||
return "\(backend.label) - \(resolution.description) - \(formatsDescription)"
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ struct QualityProfileBridge: Defaults.Bridge {
|
||||
typealias Serializable = [String: String]
|
||||
|
||||
func serialize(_ value: Value?) -> Serializable? {
|
||||
guard let value = value else { return nil }
|
||||
guard let value else { return nil }
|
||||
|
||||
return [
|
||||
"id": value.id,
|
||||
@@ -105,7 +105,7 @@ struct QualityProfileBridge: Defaults.Bridge {
|
||||
}
|
||||
|
||||
func deserialize(_ object: Serializable?) -> Value? {
|
||||
guard let object = object,
|
||||
guard let object,
|
||||
let id = object["id"],
|
||||
let backend = PlayerBackendType(rawValue: object["backend"] ?? ""),
|
||||
let resolution = ResolutionSetting(rawValue: object["resolution"] ?? "")
|
||||
|
Reference in New Issue
Block a user