Skip to content

Commit 9c5224b

Browse files
committed
Fix build warnings that was annoying
1 parent 65cf9d3 commit 9c5224b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Rebus.Diagnostics.Tests/Incoming/HandlerInvokerWrapperTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task CreatesNewSubActivityIfThereIsAnActiveActivity()
4444
}
4545

4646
[Test]
47-
public async Task MarksActivityAsFailedIfHandlerThrows()
47+
public void MarksActivityAsFailedIfHandlerThrows()
4848
{
4949
using var activity = new Activity("MyActivity");
5050

Rebus.Diagnostics.Tests/Incoming/IncomingDiagnosticsStepTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private string RenderString(string message, object[] objs)
331331
/// <summary>
332332
/// Formatter function that is invoked for each object value to be rendered into a string while interpolating log lines
333333
/// </summary>
334-
private string FormatObject(object obj, string format)
334+
private string FormatObject(object obj, string? format)
335335
{
336336
if (obj is string) return $@"""{obj}""";
337337
if (obj is IEnumerable)
@@ -345,7 +345,7 @@ private string FormatObject(object obj, string format)
345345
if (obj is DateTimeOffset) return ((DateTimeOffset) obj).ToString(format ?? "O");
346346
if (obj is IFormattable) return ((IFormattable) obj).ToString(format, CultureInfo.InvariantCulture);
347347
if (obj is IConvertible) return ((IConvertible) obj).ToString(CultureInfo.InvariantCulture);
348-
return obj.ToString();
348+
return obj.ToString()!;
349349
}
350350

351351
#endregion

Rebus.Diagnostics.Tests/Outgoing/OutgoingDiagnosticsStepTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Rebus.Diagnostics.Tests.Outgoing
1515
[TestFixture]
1616
public class OutgoingDiagnosticsStepTests : FixtureBase
1717
{
18-
RebusTransactionScope? _scope;
18+
RebusTransactionScope _scope = null!;
1919

2020
[OneTimeSetUp]
2121
public static void ListenForRebus()

0 commit comments

Comments
 (0)