Skip to content

Commit

Permalink
Fix nullable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Mar 19, 2024
1 parent be67633 commit a394fd7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public bool SupportsPath(string virtualPath)
options.IgnorePrefixCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal));
}

private static string SanitizeImageExtension(string extension)
private static string? SanitizeImageExtension(string extension)
{
//TODO: Deduplicate this function when making Imazen.ImageAPI.Client
extension = extension.ToLowerInvariant().TrimStart('.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ namespace Imageflow.Server.Storage.RemoteReader
public class RemoteReaderServiceOptions
{
internal readonly List<string> Prefixes = new List<string>();
public string SigningKey { get; set; }
public required string SigningKey { get; set; }

/// <summary>
/// Sometimes you need to support multiple signing keys; either for different users or for
/// phasing out a leaked key. Trying multiple keys during each request adds a bit a processing time;
/// benchmark performance if you have many.
/// </summary>
public IEnumerable<string> SigningKeys { get; set; }
public IEnumerable<string>? SigningKeys { get; set; }
public bool IgnorePrefixCase { get; set; }

public Func<Uri, string> HttpClientSelector { get; set; } = _ => "";
Expand Down
2 changes: 1 addition & 1 deletion src/Imazen.HybridCache/AsyncCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ private static bool IsFileLocked(IOException exception)
//
//

private BlobCacheSupportData SupportData { get; set; }
private BlobCacheSupportData? SupportData { get; set; }
public void Initialize(BlobCacheSupportData supportData)
{
SupportData = supportData;
Expand Down
2 changes: 1 addition & 1 deletion src/Imazen.HybridCache/HybridCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class HybridCache : IBlobCache
private CleanupManager CleanupManager { get; }
private ICacheDatabase<ICacheDatabaseRecord> Database { get; }

private BlobCacheSupportData SupportData { get; set; }
private BlobCacheSupportData? SupportData { get; set; }

public string UniqueName { get; }

Expand Down
6 changes: 5 additions & 1 deletion tests/ImazenShared.Tests/Routing/Serving/MemoryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public class MemoryLogger(string categoryName, Func<string, LogLevel, bool>? fil

private static readonly AsyncLocal<Stack<object>> Scopes = new AsyncLocal<Stack<object>>();

public IDisposable BeginScope<TState>(TState state)
public IDisposable BeginScope<TState>(TState state)
#if DOTNET8_0_OR_GREATER
where TState : notnull
#endif
where TState : notnull
{
if (state == null)
throw new ArgumentNullException(nameof(state));
Expand Down

0 comments on commit a394fd7

Please sign in to comment.