From dd9fa550a4fc3ed6e1e5e098bb91fdef214e2cd9 Mon Sep 17 00:00:00 2001 From: Leif Date: Tue, 30 Jan 2024 18:58:02 -0700 Subject: [PATCH] Remove String only logic --- .../Types/State/Application+FileState.swift | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Sources/AppState/Application/Types/State/Application+FileState.swift b/Sources/AppState/Application/Types/State/Application+FileState.swift index 5476019..1ed8dde 100644 --- a/Sources/AppState/Application/Types/State/Application+FileState.swift +++ b/Sources/AppState/Application/Types/State/Application+FileState.swift @@ -26,14 +26,7 @@ extension Application { } do { - if - Value.self == String.self, - let stringValue = try? fileManager.string(path: path, filename: filename) as? Value - { - return stringValue - } else { - return try fileManager.in(path: path, filename: filename) - } + return try fileManager.in(path: path, filename: filename) } catch { log( error: error, @@ -76,11 +69,7 @@ extension Application { ) do { - if let stringValue = newValue as? String { - try fileManager.out(string: stringValue, path: path, filename: filename) - } else { - try fileManager.out(newValue, path: path, filename: filename) - } + try fileManager.out(newValue, path: path, filename: filename) } catch { log( error: error,