Skip to content

Commit 3bd3504

Browse files
authored
fixup minor reported diagnostics (#101)
1 parent 636fd63 commit 3bd3504

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Dapper.AOT.Analyzers/CodeAnalysis/Diagnostics.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ private static DiagnosticDescriptor Create(string id, string title, string messa
2525

2626
protected static DiagnosticDescriptor LibraryInfo(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Library, DiagnosticSeverity.Info);
2727

28-
protected static DiagnosticDescriptor SqlWarning(string id, string title, string messageFormat, bool docs = true) => Create(id, title, messageFormat, Category.Sql, DiagnosticSeverity.Warning);
28+
protected static DiagnosticDescriptor SqlWarning(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Sql, DiagnosticSeverity.Warning);
2929

30-
protected static DiagnosticDescriptor SqlError(string id, string title, string messageFormat, bool docs = true) => Create(id, title, messageFormat, Category.Sql, DiagnosticSeverity.Error);
30+
protected static DiagnosticDescriptor SqlError(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Sql, DiagnosticSeverity.Error);
3131

32-
protected static DiagnosticDescriptor SqlInfo(string id, string title, string messageFormat, bool docs = true) => Create(id, title, messageFormat, Category.Sql, DiagnosticSeverity.Info);
32+
protected static DiagnosticDescriptor SqlInfo(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Sql, DiagnosticSeverity.Info);
3333

3434
protected static DiagnosticDescriptor PerformanceWarning(string id, string title, string messageFormat) => Create(id, title, messageFormat, Category.Performance, DiagnosticSeverity.Warning);
3535

src/Dapper.AOT/TypeAccessor.AccessorDataReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public AccessorDataReader(TypeAccessor<T> accessor, string[]? members, bool exac
183183
int[] tokens;
184184
if (members is null || members.Length == 0)
185185
{
186-
_tokens = tokens = accessor.MemberCount == 0 ? Array.Empty<int>() : new int[accessor.MemberCount];
186+
_tokens = tokens = accessor.MemberCount == 0 ? [] : new int[accessor.MemberCount];
187187
for (int i = 0; i < tokens.Length; i++)
188188
{
189189
tokens[i] = i;

test/Dapper.AOT.Test/Integration/BulkInsertIngegrationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ public BulkInsertIntegrationTests(SqlClientFixture fixture)
2020

2121
public void Dispose() => _connection?.Dispose();
2222

23-
IEnumerable<Foo> GenerateRows(int count)
23+
static IEnumerable<Foo> GenerateRows(int count)
2424
{
2525
for (int i = 0; i < count; i++)
2626
{
2727
yield return new Foo { Id = i, Name = $"row {i}" };
2828
}
2929
}
3030

31-
async IAsyncEnumerable<Foo> GenerateRowsAsync(int count)
31+
static async IAsyncEnumerable<Foo> GenerateRowsAsync(int count)
3232
{
3333
for (int i = 0; i < count; i++)
3434
{
@@ -96,7 +96,7 @@ await table.WriteToServerAsync(TypeAccessor.CreateDataReader(GenerateRowsAsync(1
9696
internal class Foo
9797
{
9898
public int Id { get; set; }
99-
public string Name { get; set; }
99+
public string Name { get; set; } = null!;
100100
}
101101
}
102102

0 commit comments

Comments
 (0)