From 779ced6da10e35df9273b95928ed182cddecee27 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 2 Dec 2023 22:36:15 +0100 Subject: Reformat --- MatrixRoomUtils.Desktop/FileStorageProvider.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'MatrixRoomUtils.Desktop/FileStorageProvider.cs') diff --git a/MatrixRoomUtils.Desktop/FileStorageProvider.cs b/MatrixRoomUtils.Desktop/FileStorageProvider.cs index 7f73cf3..0429d1a 100644 --- a/MatrixRoomUtils.Desktop/FileStorageProvider.cs +++ b/MatrixRoomUtils.Desktop/FileStorageProvider.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using System.Text.Json; using ArcaneLibs.Extensions; using LibMatrix.Extensions; @@ -19,13 +20,14 @@ public class FileStorageProvider : IStorageProvider { new Logger(new LoggerFactory()).LogInformation("test"); Console.WriteLine($"Initialised FileStorageProvider with path {targetPath}"); TargetPath = targetPath; - if(!Directory.Exists(targetPath)) { + if (!Directory.Exists(targetPath)) { Directory.CreateDirectory(targetPath); } } public async Task SaveObjectAsync(string key, T value) => await File.WriteAllTextAsync(Path.Join(TargetPath, key), value?.ToJson()); + [RequiresUnreferencedCode("This API uses reflection to deserialize JSON")] public async Task LoadObjectAsync(string key) => JsonSerializer.Deserialize(await File.ReadAllTextAsync(Path.Join(TargetPath, key))); public Task ObjectExistsAsync(string key) => Task.FromResult(File.Exists(Path.Join(TargetPath, key))); -- cgit 1.5.1