Fix IDE0250

This commit is contained in:
RoosterDragon
2023-02-19 12:39:18 +00:00
committed by Pavel Penev
parent 5e52d067c8
commit 5a2a448c32
3 changed files with 5 additions and 2 deletions

View File

@@ -216,6 +216,9 @@ dotnet_diagnostic.IDE0120.severity = warning
# Use tuple to swap values. # Use tuple to swap values.
dotnet_diagnostic.IDE0180.severity = warning dotnet_diagnostic.IDE0180.severity = warning
# Make struct 'readonly'.
dotnet_diagnostic.IDE0250.severity = warning
# Naming rule violation. # Naming rule violation.
dotnet_diagnostic.IDE1006.severity = warning dotnet_diagnostic.IDE1006.severity = warning

View File

@@ -188,7 +188,7 @@ namespace OpenRA.Network
public (string[] Names, Values Values) NamesValues; public (string[] Names, Values Values) NamesValues;
} }
struct TypeInfo readonly struct TypeInfo
{ {
static readonly ParameterExpression SyncParam = Expression.Parameter(typeof(ISync), "sync"); static readonly ParameterExpression SyncParam = Expression.Parameter(typeof(ISync), "sync");
static readonly ConstantExpression NullString = Expression.Constant(null, typeof(string)); static readonly ConstantExpression NullString = Expression.Constant(null, typeof(string));

View File

@@ -17,7 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits namespace OpenRA.Mods.Common.Traits
{ {
public struct ResourceLayerContents public readonly struct ResourceLayerContents
{ {
public static readonly ResourceLayerContents Empty = default; public static readonly ResourceLayerContents Empty = default;
public readonly string Type; public readonly string Type;