Updated common abstractions

This commit is contained in:
Toastie (DCS Team) 2024-06-26 17:59:28 +12:00
parent 4fe4c4eff2
commit b045015efb
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
23 changed files with 47 additions and 51 deletions

View file

@ -1,4 +1,4 @@
using OneOf;
using OneOf;
using OneOf.Types;
namespace Ellie.Common;

View file

@ -63,7 +63,7 @@ public sealed class MemoryBotCache : IBotCache
{
lock (_cacheLock)
{
var toReturn = _cache.TryGetValue(key.Key, out var old) && old is not null;
var toReturn = _cache.TryGetValue(key.Key, out var old ) && old is not null;
_cache.Remove(key.Key);
return new(toReturn);
}

View file

@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
namespace System.Collections.Generic;
@ -46,12 +46,8 @@ public sealed class ConcurrentHashSet<T> : IReadOnlyCollection<T>, ICollection<T
public void CopyTo(T[] array, int arrayIndex)
{
ArgumentNullException.ThrowIfNull(array);
if (arrayIndex < 0)
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
if (arrayIndex >= array.Length)
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
ArgumentOutOfRangeException.ThrowIfNegative(arrayIndex);
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length);
CopyToInternal(array, arrayIndex);
}

View file

@ -1,4 +1,4 @@
using System.Collections;
using System.Collections;
namespace Ellie.Common;

View file

@ -1,4 +1,4 @@
using System.Security.Cryptography;
using System.Security.Cryptography;
namespace Ellie.Common;

View file

@ -1,4 +1,4 @@
using System.Security.Cryptography;
using System.Security.Cryptography;
namespace Ellie.Common;

View file

@ -1,4 +1,4 @@
namespace Ellie.Common;
namespace Ellie.Common;
public static class Extensions
{

View file

@ -1,4 +1,4 @@
using EllieBot.Common.Yml;
using EllieBot.Common.Yml;
using System.Text;
using System.Text.RegularExpressions;

View file

@ -1,4 +1,4 @@
namespace Ellie.Common;
namespace Ellie.Common;
public static class StandardConversions
{

View file

@ -1,4 +1,4 @@
namespace Ellie.Common;
namespace Ellie.Common;
public interface IPubSub
{

View file

@ -1,4 +1,4 @@
namespace Ellie.Common;
namespace Ellie.Common;
public interface ISeria
{

View file

@ -1,4 +1,4 @@
namespace Ellie.Common;
namespace Ellie.Common;
public readonly struct TypedKey<TData>
{

View file

@ -1,11 +1,12 @@
#nullable disable
#nullable disable
namespace EllieBot;
public interface IBotCredentials
{
string Token { get; }
string GoogleApiKey { get; }
string EllieAiToken { get; }
ICollection<ulong> OwnerIds { get; set; }
string GoogleApiKey { get; }
bool UsePrivilegedIntents { get; }
string RapidApiKey { get; }

View file

@ -1,4 +1,4 @@
#nullable disable
#nullable disable
using System.Globalization;
namespace EllieBot.Common;

View file

@ -1,4 +1,4 @@
#nullable disable
#nullable disable
namespace EllieBot.Services;
/// <summary>

View file

@ -1,5 +1,4 @@
#nullable disable
namespace EllieBot.Services;
/// <summary>