From 5f7a92a74592a53529890eebb1ee9fe519afd92f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 12 Apr 2022 20:52:01 -0400 Subject: enable nullable annotations in unit tests (#837) --- src/SMAPI.Toolkit/Framework/Clients/Wiki/ChangeDescriptor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/SMAPI.Toolkit/Framework/Clients/Wiki') diff --git a/src/SMAPI.Toolkit/Framework/Clients/Wiki/ChangeDescriptor.cs b/src/SMAPI.Toolkit/Framework/Clients/Wiki/ChangeDescriptor.cs index 5978803e..8646f1cc 100644 --- a/src/SMAPI.Toolkit/Framework/Clients/Wiki/ChangeDescriptor.cs +++ b/src/SMAPI.Toolkit/Framework/Clients/Wiki/ChangeDescriptor.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki @@ -47,6 +48,9 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki /// Apply the change descriptors to a comma-delimited field. /// The raw field text. /// Returns the modified field. +#if NET5_0_OR_GREATER + [return: NotNullIfNotNull("rawField")] +#endif public string? ApplyToCopy(string? rawField) { // get list @@ -119,7 +123,7 @@ namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki /// The raw change descriptor. /// The human-readable error message describing any invalid values that were ignored. /// Format a raw value into a normalized form if needed. - public static ChangeDescriptor Parse(string descriptor, out string[] errors, Func? formatValue = null) + public static ChangeDescriptor Parse(string? descriptor, out string[] errors, Func? formatValue = null) { // init formatValue ??= p => p; -- cgit