mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Use Swift 5.7 if-let style
This commit is contained in:
@@ -59,7 +59,7 @@ struct Account: Defaults.Serializable, Hashable, Identifiable {
|
||||
var shortUsername: String {
|
||||
let (username, _) = credentials
|
||||
|
||||
guard let username = username,
|
||||
guard let username,
|
||||
username.count > 10
|
||||
else {
|
||||
return username ?? ""
|
||||
@@ -70,7 +70,7 @@ struct Account: Defaults.Serializable, Hashable, Identifiable {
|
||||
}
|
||||
|
||||
var description: String {
|
||||
guard let name = name, !name.isEmpty else {
|
||||
guard let name, !name.isEmpty else {
|
||||
return shortUsername
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ struct AccountsBridge: Defaults.Bridge {
|
||||
typealias Serializable = [String: String]
|
||||
|
||||
func serialize(_ value: Value?) -> Serializable? {
|
||||
guard let value = value else {
|
||||
guard let value else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ struct AccountsBridge: Defaults.Bridge {
|
||||
|
||||
func deserialize(_ object: Serializable?) -> Value? {
|
||||
guard
|
||||
let object = object,
|
||||
let object,
|
||||
let id = object["id"],
|
||||
let instanceID = object["instanceID"],
|
||||
let url = object["apiURL"],
|
||||
|
@@ -6,7 +6,7 @@ struct InstancesBridge: Defaults.Bridge {
|
||||
typealias Serializable = [String: String]
|
||||
|
||||
func serialize(_ value: Value?) -> Serializable? {
|
||||
guard let value = value else {
|
||||
guard let value else {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ struct InstancesBridge: Defaults.Bridge {
|
||||
|
||||
func deserialize(_ object: Serializable?) -> Value? {
|
||||
guard
|
||||
let object = object,
|
||||
let object,
|
||||
let app = VideosApp(rawValue: object["app"] ?? ""),
|
||||
let id = object["id"],
|
||||
let apiURL = object["apiURL"]
|
||||
|
Reference in New Issue
Block a user