Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 1c68ce4

Browse files
author
stas
committed
add StringBuilder to CSharpExtensions
1 parent c95b192 commit 1c68ce4

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/ApiService/ApiService/Log.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public LogStringHandler(int literalLength, int formattedCount) {
2121
}
2222

2323
public void AppendLiteral(string message) {
24-
_ = _builder.Append(message);
24+
_builder.Append(message);
2525
}
2626

2727
public void AppendFormatted<T>(T message) {
28-
_ = _builder.Append(message?.ToString());
28+
_builder.Append(message?.ToString());
2929
}
3030

3131
public void AppendFormatted<T>(T message, string? format) {
@@ -35,11 +35,11 @@ public void AppendFormatted<T>(T message, string? format) {
3535
_tags = new Dictionary<string, string>();
3636
}
3737
_tags[tag] = $"{message}";
38-
_ = _builder.Append('{').Append(tag).Append('}');
38+
_builder.Append('{').Append(tag).Append('}');
3939
} else if (message is IFormattable msg) {
40-
_ = _builder.Append(msg?.ToString(format, null));
40+
_builder.Append(msg?.ToString(format, null));
4141
} else {
42-
_ = _builder.Append(message?.ToString()).Append(':').Append(format);
42+
_builder.Append(message?.ToString()).Append(':').Append(format);
4343
}
4444
}
4545

src/ApiService/ApiService/onefuzzlib/Queue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ public async Async.Task<bool> RemoveFirstMessage(string name, StorageType storag
115115
foreach (var msg in msgs.Value) {
116116
var resp = await client.DeleteMessageAsync(msg.MessageId, msg.PopReceipt);
117117
if (resp.IsError) {
118-
_log.Error($"failed to delete message from the {name:Tag:QueueName} due to {resp.ReasonPhrase:Tag:Error}");
118+
_log.Error($"failed to delete message from the {name:Tag:QueueName} due to {resp.ReasonPhrase:Tag:Error}");
119119
return false;
120120
} else {
121121
return true;
122122
}
123123
}
124124
} catch (RequestFailedException ex) when (ex.Status == 404 || ex.ErrorCode == "QueueNotFound") {
125-
_log.Info($"tried to remove message from queue {name} but it doesn't exist");
125+
_log.Info($"tried to remove message from queue {name:Tag:QueueName} but it doesn't exist");
126126
return false;
127127
}
128128

src/ApiService/CSharpExtensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder",
77
"Microsoft.Extensions.DependencyInjection.IServiceCollection",
88
"Moq.Language.Flow.IReturnsResult",
9-
"FluentAssertions.AndConstraint"
9+
"FluentAssertions.AndConstraint",
10+
"System.Text.StringBuilder"
1011
]
1112
}
1213
}

0 commit comments

Comments
 (0)