Skip to content

Commit

Permalink
Fix-up branch
Browse files Browse the repository at this point in the history
- Fix packages after bad rebase.
- Revert `scoped` changes after change to use C# 10.
  • Loading branch information
martincostello committed Aug 30, 2023
1 parent f7bd2f3 commit 4cfe562
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="Moq" Version="4.20.0" />
<PackageVersion Include="NSubstitute" Version="5.0.0" />
<PackageVersion Include="ReportGenerator" Version="5.1.24" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="xunit" Version="2.5.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/JustEat.StatsD/Buffered/StatsDUtf8Formatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ private static bool TryWriteSampleRateIfNeeded(ref Buffer<byte> buffer, double s
: 0;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool TryWriteBucketNameTagsIfNeeded(scoped ref Buffer<byte> buffer, in Dictionary<string, string?>? tags) =>
private bool TryWriteBucketNameTagsIfNeeded(ref Buffer<byte> buffer, in Dictionary<string, string?>? tags) =>
!AreTagsPresent(tags) ||
_tagsFormatter.AreTrailing ||
buffer.TryWriteUtf8Chars(_tagsFormatter.FormatTags(tags!));

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool TryWriteTrailingTagsIfNeeded(scoped ref Buffer<byte> buffer, in Dictionary<string, string?>? tags) =>
private bool TryWriteTrailingTagsIfNeeded(ref Buffer<byte> buffer, in Dictionary<string, string?>? tags) =>
!AreTagsPresent(tags) ||
!_tagsFormatter.AreTrailing ||
buffer.TryWriteUtf8Chars(_tagsFormatter.FormatTags(tags!));
Expand Down
4 changes: 2 additions & 2 deletions src/JustEat.StatsD/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ JustEat.StatsD.TagsFormatter
JustEat.StatsD.TagsFormatters.IStatsDTagsFormatter
JustEat.StatsD.TagsFormatters.IStatsDTagsFormatter.AreTrailing.get -> bool
JustEat.StatsD.TagsFormatters.IStatsDTagsFormatter.GetTagsBufferSize(in System.Collections.Generic.Dictionary<string!, string?>! tags) -> int
JustEat.StatsD.TagsFormatters.IStatsDTagsFormatter.FormatTags(scoped in System.Collections.Generic.Dictionary<string!, string?>! tags) -> System.ReadOnlySpan<char>
JustEat.StatsD.TagsFormatters.IStatsDTagsFormatter.FormatTags(in System.Collections.Generic.Dictionary<string!, string?>! tags) -> System.ReadOnlySpan<char>
JustEat.StatsD.TagsFormatters.StatsDTagsFormatter
virtual JustEat.StatsD.TagsFormatters.StatsDTagsFormatter.AreTrailing.get -> bool
JustEat.StatsD.TagsFormatters.StatsDTagsFormatter.StatsDTagsFormatter(JustEat.StatsD.TagsFormatters.StatsDTagsFormatterConfiguration! configuration) -> void
Expand Down Expand Up @@ -116,4 +116,4 @@ static JustEat.StatsD.TimerExtensions.Time<T>(this JustEat.StatsD.IStatsDPublish
static JustEat.StatsD.TimerExtensions.Time<T>(this JustEat.StatsD.IStatsDPublisher! publisher, string! bucket, System.Func<System.Threading.Tasks.Task<T>!>! func, System.Collections.Generic.Dictionary<string!, string?>? tags = null) -> System.Threading.Tasks.Task<T>!
static JustEat.StatsD.TimerExtensions.Time<T>(this JustEat.StatsD.IStatsDPublisher! publisher, string! bucket, System.Func<T>! func, System.Collections.Generic.Dictionary<string!, string?>? tags = null) -> T
virtual JustEat.StatsD.TagsFormatters.StatsDTagsFormatter.GetTagsBufferSize(in System.Collections.Generic.Dictionary<string!, string?>! tags) -> int
virtual JustEat.StatsD.TagsFormatters.StatsDTagsFormatter.FormatTags(scoped in System.Collections.Generic.Dictionary<string!, string?>! tags) -> System.ReadOnlySpan<char>
virtual JustEat.StatsD.TagsFormatters.StatsDTagsFormatter.FormatTags(in System.Collections.Generic.Dictionary<string!, string?>! tags) -> System.ReadOnlySpan<char>
2 changes: 1 addition & 1 deletion src/JustEat.StatsD/TagsFormatters/IStatsDTagsFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ public interface IStatsDTagsFormatter
/// </summary>
/// <param name="tags">The tag(s) included.</param>
/// <returns>The tag(s) formatted.</returns>
ReadOnlySpan<char> FormatTags(scoped in Dictionary<string, string?> tags);
ReadOnlySpan<char> FormatTags(in Dictionary<string, string?> tags);
}
2 changes: 1 addition & 1 deletion src/JustEat.StatsD/TagsFormatters/NoOpTagsFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ internal sealed class NoOpTagsFormatter : IStatsDTagsFormatter

public int GetTagsBufferSize(in Dictionary<string, string?> tags) => 0;

public ReadOnlySpan<char> FormatTags(scoped in Dictionary<string, string?> tags) => ReadOnlySpan<char>.Empty;
public ReadOnlySpan<char> FormatTags(in Dictionary<string, string?> tags) => ReadOnlySpan<char>.Empty;
}
2 changes: 1 addition & 1 deletion src/JustEat.StatsD/TagsFormatters/StatsDTagsFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public virtual int GetTagsBufferSize(in Dictionary<string, string?> tags)
}

/// <inheritdoc />
public virtual ReadOnlySpan<char> FormatTags(scoped in Dictionary<string, string?> tags)
public virtual ReadOnlySpan<char> FormatTags(in Dictionary<string, string?> tags)
{
if (!AreTagsPresent(tags))
{
Expand Down
2 changes: 1 addition & 1 deletion tests/JustEat.StatsD.Tests/Utf8TagsFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,6 @@ private sealed class AlwaysNullStatsDTagsFormatter : IStatsDTagsFormatter

public int GetTagsBufferSize(in Dictionary<string, string?> tags) => 0;

public ReadOnlySpan<char> FormatTags(scoped in Dictionary<string, string?> tags) => null;
public ReadOnlySpan<char> FormatTags(in Dictionary<string, string?> tags) => null;
}
}

0 comments on commit 4cfe562

Please sign in to comment.