Skip to content

Commit 100701e

Browse files
Set LangVersion to 11 (Azure#33862)
* Bump LangVersion * Switch to fixed
1 parent e7dea2a commit 100701e

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

eng/Directory.Build.Common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<!-- Setup default project properties -->
2929
<PropertyGroup>
30-
<LangVersion>9</LangVersion>
30+
<LangVersion>11</LangVersion>
3131
<!--
3232
Disable NU5105 NuGet Pack warning that the version is SemVer 2.0.
3333
SemVer 2.0 is supported by NuGet since 3.0.0 (July 2015) in some capacity, and fully since 3.5.0 (October 2016).

sdk/core/Azure.Core/src/RequestFailedException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ internal static (string FormattedError, string? ErrorCode, IDictionary<string, s
183183
foreach (HttpHeader responseHeader in response.Headers)
184184
{
185185
string headerValue = response.Sanitizer.SanitizeHeader(responseHeader.Name, responseHeader.Value);
186-
messageBuilder.AppendLine($"{responseHeader.Name}: {headerValue}");
186+
string header = $"{responseHeader.Name}: {headerValue}";
187+
messageBuilder.AppendLine(header);
187188
}
188189

189190
var formatMessage = messageBuilder.ToString();

sdk/core/Azure.Core/src/ResourceIdentifier.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ private static ResourceType ChooseResourceType(ReadOnlySpan<char> resourceTypeNa
278278
return "Invalid resource id.";
279279
}
280280

281-
private static ReadOnlySpan<char> PopNextWord(ref ReadOnlySpan<char> remaining)
281+
private static ReadOnlySpan<char> PopNextWord(scoped ref ReadOnlySpan<char> remaining)
282282
{
283283
int index = remaining.IndexOf(Separator);
284284
if (index < 0)
@@ -350,14 +350,13 @@ private string ToResourceString()
350350
StringBuilder builder = new StringBuilder(initial);
351351
if (!IsProviderResource)
352352
{
353-
builder.Append($"/{ResourceType.GetLastType()}");
353+
builder.Append('/').Append(ResourceType.GetLastType());
354354
if (!string.IsNullOrWhiteSpace(Name))
355-
builder.Append($"/{Name}");
355+
builder.Append('/').Append(Name);
356356
}
357357
else
358358
{
359-
builder.Append(ProviderStart)
360-
.Append($"{ResourceType}/{Name}");
359+
builder.Append(ProviderStart).Append(ResourceType).Append('/').Append(Name);
361360
}
362361

363362
return builder.ToString();

sdk/core/Azure.Core/src/Shared/ClientDiagnostics.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ internal static string CreateRequestFailedMessageWithContent(Response response,
190190
foreach (HttpHeader responseHeader in response.Headers)
191191
{
192192
string headerValue = sanitizer.SanitizeHeader(responseHeader.Name, responseHeader.Value);
193-
messageBuilder.AppendLine($"{responseHeader.Name}: {headerValue}");
193+
string header = $"{responseHeader.Name}: {headerValue}";
194+
messageBuilder.AppendLine(header);
194195
}
195196

196197
return messageBuilder.ToString();

0 commit comments

Comments
 (0)