Kotz's editorconfig styles slightly modified. Target typed new usage. Brackets in expressions used for clarity.

This commit is contained in:
Kwoth
2021-12-26 02:52:09 +01:00
parent 68741ec484
commit d18f9429c6
172 changed files with 921 additions and 494 deletions

View File

@@ -2,9 +2,8 @@
public class EventPubSub : IPubSub
{
private readonly Dictionary<string, Dictionary<Delegate, List<Func<object, ValueTask>>>> _actions
= new Dictionary<string, Dictionary<Delegate, List<Func<object, ValueTask>>>>();
private readonly object locker = new object();
private readonly Dictionary<string, Dictionary<Delegate, List<Func<object, ValueTask>>>> _actions = new();
private readonly object locker = new();
public Task Sub<TData>(in TypedKey<TData> key, Func<TData, ValueTask> action)
{

View File

@@ -5,7 +5,7 @@ namespace NadekoBot.Common;
public class JsonSeria : ISeria
{
private JsonSerializerOptions serializerOptions = new JsonSerializerOptions()
private readonly JsonSerializerOptions serializerOptions = new()
{
Converters =
{

View File

@@ -10,7 +10,7 @@ public readonly struct TypedKey<TData>
}
public static implicit operator TypedKey<TData>(in string input)
=> new TypedKey<TData>(input);
=> new(input);
public static implicit operator string(in TypedKey<TData> input)
=> input.Key;

View File

@@ -11,7 +11,7 @@ public class YamlSeria : IConfigSeria
private readonly IDeserializer _deserializer;
private static readonly Regex CodePointRegex
= new Regex(@"(\\U(?<code>[a-zA-Z0-9]{8})|\\u(?<code>[a-zA-Z0-9]{4})|\\x(?<code>[a-zA-Z0-9]{2}))",
= new(@"(\\U(?<code>[a-zA-Z0-9]{8})|\\u(?<code>[a-zA-Z0-9]{4})|\\x(?<code>[a-zA-Z0-9]{2}))",
RegexOptions.Compiled);
public YamlSeria()