From 1f2269dcf2684473965c4f96f980f79fad8268fc Mon Sep 17 00:00:00 2001 From: Archi Date: Wed, 3 Jan 2024 15:06:08 +0100 Subject: [PATCH] Misc code syntax --- .../SteamTokenDumperController.cs | 2 +- ArchiSteamFarm/SharedInfo.cs | 6 +++--- ArchiSteamFarm/Steam/Storage/BotConfig.cs | 6 +++--- ArchiSteamFarm/Storage/GlobalConfig.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperController.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperController.cs index 73744439887b9..0116141a2852c 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperController.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/SteamTokenDumperController.cs @@ -30,6 +30,6 @@ namespace ArchiSteamFarm.OfficialPlugins.SteamTokenDumper; public sealed class SteamTokenDumperController : ArchiController { [HttpGet(nameof(GlobalConfigExtension))] [ProducesResponseType((int) HttpStatusCode.OK)] - [SwaggerOperation(Tags = new[] { nameof(GlobalConfigExtension) })] + [SwaggerOperation(Tags = [nameof(GlobalConfigExtension)])] public ActionResult Get() => Ok(new GlobalConfigExtension()); } diff --git a/ArchiSteamFarm/SharedInfo.cs b/ArchiSteamFarm/SharedInfo.cs index 275878d0e57a3..6c17bfe45f533 100644 --- a/ArchiSteamFarm/SharedInfo.cs +++ b/ArchiSteamFarm/SharedInfo.cs @@ -69,13 +69,13 @@ public static class SharedInfo { internal const string WebsiteDirectory = "www"; [PublicAPI] - public static readonly char[] ListElementSeparators = { ',' }; + public static readonly char[] ListElementSeparators = [',']; [PublicAPI] - public static readonly string[] NewLineIndicators = { "\r\n", "\r", "\n" }; + public static readonly string[] NewLineIndicators = ["\r\n", "\r", "\n"]; [PublicAPI] - public static readonly string[] RangeIndicators = { ".." }; + public static readonly string[] RangeIndicators = [".."]; internal static string HomeDirectory { get { diff --git a/ArchiSteamFarm/Steam/Storage/BotConfig.cs b/ArchiSteamFarm/Steam/Storage/BotConfig.cs index ee66c2d14b0af..898994386a899 100644 --- a/ArchiSteamFarm/Steam/Storage/BotConfig.cs +++ b/ArchiSteamFarm/Steam/Storage/BotConfig.cs @@ -162,7 +162,7 @@ public sealed class BotConfig { public EBotBehaviour BotBehaviour { get; private set; } = DefaultBotBehaviour; [JsonProperty(Required = Required.DisallowNull)] - [SwaggerValidValues(ValidIntValues = new[] { (int) Asset.EType.FoilTradingCard, (int) Asset.EType.TradingCard })] + [SwaggerValidValues(ValidIntValues = [(int) Asset.EType.FoilTradingCard, (int) Asset.EType.TradingCard])] public ImmutableHashSet CompleteTypesToSend { get; private set; } = DefaultCompleteTypesToSend; [JsonProperty] @@ -242,13 +242,13 @@ internal set { [JsonProperty(Required = Required.DisallowNull)] [SwaggerSteamIdentifier(AccountType = EAccountType.Clan)] - [SwaggerValidValues(ValidIntValues = new[] { 0 })] + [SwaggerValidValues(ValidIntValues = [0])] public ulong SteamMasterClanID { get; private set; } = DefaultSteamMasterClanID; [JsonProperty] [MaxLength(SteamParentalCodeLength)] [MinLength(SteamParentalCodeLength)] - [SwaggerValidValues(ValidStringValues = new[] { "0" })] + [SwaggerValidValues(ValidStringValues = ["0"])] [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode", Justification = "This is optional, supportive attribute, we don't care if it gets trimmed or not")] public string? SteamParentalCode { get => BackingSteamParentalCode; diff --git a/ArchiSteamFarm/Storage/GlobalConfig.cs b/ArchiSteamFarm/Storage/GlobalConfig.cs index 59b9440bd0939..8b86bbb1605bb 100644 --- a/ArchiSteamFarm/Storage/GlobalConfig.cs +++ b/ArchiSteamFarm/Storage/GlobalConfig.cs @@ -282,7 +282,7 @@ internal set { [JsonProperty(Required = Required.DisallowNull)] [SwaggerSteamIdentifier] - [SwaggerValidValues(ValidIntValues = new[] { 0 })] + [SwaggerValidValues(ValidIntValues = [0])] public ulong SteamOwnerID { get; private set; } = DefaultSteamOwnerID; [JsonProperty(Required = Required.DisallowNull)]