From 078909169d3debc45fee277f0c840663a3de3a5c Mon Sep 17 00:00:00 2001 From: GreemDev Date: Sun, 16 Mar 2025 14:21:17 -0500 Subject: [PATCH] misc: chore: Simplify ReleaseChannels creation --- src/Ryujinx.Common/ReleaseInformation.cs | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Ryujinx.Common/ReleaseInformation.cs b/src/Ryujinx.Common/ReleaseInformation.cs index c6644ffd6..a6119b2b2 100644 --- a/src/Ryujinx.Common/ReleaseInformation.cs +++ b/src/Ryujinx.Common/ReleaseInformation.cs @@ -49,23 +49,22 @@ namespace Ryujinx.Common public static async Task GetReleaseChannelsAsync(HttpClient httpClient) { ReleaseChannelPair releaseChannelPair = JsonHelper.Deserialize(await httpClient.GetStringAsync("https://ryujinx.app/api/release-channels"), ReleaseChannelPairContext.Default.ReleaseChannelPair); - return ReleaseChannels.Create(releaseChannelPair); + return new ReleaseChannels(releaseChannelPair); } } - public struct ReleaseChannels + public readonly struct ReleaseChannels { - internal static ReleaseChannels Create(ReleaseChannelPair channelPair) => - new() - { - Stable = new Channel(channelPair.Stable), - Canary = new Channel(channelPair.Canary) - }; + internal ReleaseChannels(ReleaseChannelPair channelPair) + { + Stable = new Channel(channelPair.Stable); + Canary = new Channel(channelPair.Canary); + } - public Channel Stable { get; init; } - public Channel Canary { get; init; } + public readonly Channel Stable; + public readonly Channel Canary; - public struct Channel + public readonly struct Channel { public Channel(string raw) { @@ -74,8 +73,8 @@ namespace Ryujinx.Common Repo = parts[1]; } - public string Owner; - public string Repo; + public readonly string Owner; + public readonly string Repo; public override string ToString() => $"{Owner}/{Repo}";