mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Final Rider inspections
This commit is contained in:
@@ -75,7 +75,7 @@ public sealed class TypeController : ArchiController {
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PropertyInfo property in targetType.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).Where(static property => property.CanRead && (property.GetMethod?.IsPrivate == false))) {
|
||||
foreach (PropertyInfo property in targetType.GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).Where(static property => property is { CanRead: true, GetMethod.IsPrivate: false })) {
|
||||
JsonPropertyAttribute? jsonProperty = property.GetCustomAttribute<JsonPropertyAttribute>();
|
||||
|
||||
if (jsonProperty != null) {
|
||||
|
||||
@@ -101,7 +101,7 @@ internal sealed class Startup {
|
||||
app.UseStaticFiles(
|
||||
new StaticFileOptions {
|
||||
OnPrepareResponse = static context => {
|
||||
if (context.File.Exists && !context.File.IsDirectory && !string.IsNullOrEmpty(context.File.Name)) {
|
||||
if (context.File is { Exists: true, IsDirectory: false } && !string.IsNullOrEmpty(context.File.Name)) {
|
||||
string extension = Path.GetExtension(context.File.Name);
|
||||
|
||||
CacheControlHeaderValue cacheControl = new();
|
||||
|
||||
@@ -93,11 +93,15 @@ internal static class WebUtilities {
|
||||
StreamWriter streamWriter = new(response.Body, Encoding.UTF8);
|
||||
|
||||
await using (streamWriter.ConfigureAwait(false)) {
|
||||
using JsonTextWriter jsonWriter = new(streamWriter) {
|
||||
#pragma warning disable CA2000 // False positive, we're actually wrapping it in the using clause below exactly for that purpose
|
||||
JsonTextWriter jsonWriter = new(streamWriter) {
|
||||
CloseOutput = false
|
||||
};
|
||||
#pragma warning restore CA2000 // False positive, we're actually wrapping it in the using clause below exactly for that purpose
|
||||
|
||||
serializer.Serialize(jsonWriter, value);
|
||||
await using (jsonWriter.ConfigureAwait(false)) {
|
||||
serializer.Serialize(jsonWriter, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user