Skip to content

Commit 80041bb

Browse files
committed
resolve some warnings
1 parent 24dea22 commit 80041bb

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Magic.IndexedDb/Extensions/MagicJsInvoke.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ internal async Task CallInvokeVoidDefaultJsAsync(string modulePath, string funct
142142
}
143143

144144
private async IAsyncEnumerable<T?> MagicYieldJsAsync<T>(
145-
string modulePath, string functionName, CancellationToken token, params ITypedArgument[] args)
145+
string modulePath, string functionName,
146+
[EnumeratorCancellation] CancellationToken token,
147+
params ITypedArgument[] args)
146148
{
147149
var settings = new MagicJsonSerializationSettings() { UseCamelCase = true };
148150

Magic.IndexedDb/Helpers/ExpressionFlattener.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ private class LogicalExpressionComparer : IEqualityComparer<Expression>, ICompar
200200
{
201201
public static readonly LogicalExpressionComparer Instance = new();
202202

203-
public bool Equals(Expression x, Expression y) => Compare(x, y) == 0;
203+
public bool Equals(Expression? x, Expression? y) => Compare(x, y) is 0;
204204

205205
public int GetHashCode(Expression obj) => obj.ToString().GetHashCode();
206206

207-
public int Compare(Expression x, Expression y)
207+
public int Compare(Expression? x, Expression? y)
208208
{
209209
if (ReferenceEquals(x, y)) return 0;
210210
if (x is null) return -1;

Magic.IndexedDb/LinqTranslation/Interfaces/IMagicExecute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface IMagicExecute<T> where T : class
1818
/// </summary>
1919
/// <param name="cancellationToken"></param>
2020
/// <returns></returns>
21-
IAsyncEnumerable<T> AsAsyncEnumerable([EnumeratorCancellation] CancellationToken cancellationToken = default);
21+
IAsyncEnumerable<T> AsAsyncEnumerable(CancellationToken cancellationToken = default);
2222

2323
/// <summary>
2424
/// The order you apply does get applied correctly in the query,

Magic.IndexedDb/Models/MagicContractResolver.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ private bool IsSimpleJsonNull(JsonElement element)
159159
object? value = ReadPropertyValue(ref reader, mpe, options);
160160
propertyValues[csharpPropertyName] = value;
161161
}
162-
catch (Exception ex)
162+
catch
163163
{
164-
164+
// do nothing
165165
}
166166
}
167167
else
@@ -324,9 +324,9 @@ private bool SerializeSimple(Utf8JsonWriter writer, object value)
324324
/// <summary>
325325
/// 🔥 Serializes lists (IEnumerable)
326326
/// </summary>
327-
private bool SerializeIEnumerable(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
327+
private bool SerializeIEnumerable(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
328328
{
329-
if (value == null)
329+
if (value is null)
330330
{
331331
writer.WriteNullValue();
332332
return true;

0 commit comments

Comments
 (0)