Skip to content

Commit

Permalink
[nuget-skip] Added NuGet badges to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaoticz committed Dec 23, 2023
1 parent ff4143d commit c4f4aa9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Json2SharpLib/Emitters/CSharp/CSharpClassEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private bool HandleCustomType(ParsedJsonProperty property, StringBuilder stringB

if (!string.IsNullOrWhiteSpace(_serializationAttribute))
stringBuilder.AppendLine(CreateMemberAttribute(_indentationPadding, _serializationAttribute, property.JsonName!));

stringBuilder.AppendLine(CreateMemberDeclaration(_indentationPadding, typeName + nullableAnnotation + "[]", finalName!, _setterType));
stringBuilder.AppendLine();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class CSharpSerializationAttributeExt
/// Gets the code representation of a library serialization attribute.
/// </summary>
/// <param name="serializationAttribute">The serialization library.</param>
/// <returns>The serialization attribute's name.</returns>
/// <returns>The serialization attribute's name or <see cref="string.Empty"/> if <see cref="CSharpSerializationAttribute.NoAttribute"/>.</returns>
/// <exception cref="UnreachableException">Occurs when a serialization library is not implemented.</exception>
internal static string ToCode(this CSharpSerializationAttribute serializationAttribute)
{
Expand Down
8 changes: 3 additions & 5 deletions Json2SharpLib/Extensions/StringBuilderExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ internal static bool Contains(this StringBuilder stringBuilder, ReadOnlySpan<cha
{
for (var chunkIndex = 0; chunkIndex < chunk.Span.Length; chunkIndex++)
{
if (chunk.Span[chunkIndex] == text[textIndex])
textIndex++;
else
textIndex = 0;
textIndex = (chunk.Span[chunkIndex] == text[textIndex])
? textIndex + 1
: 0;

if (textIndex == text.Length)
return true;
Expand All @@ -52,7 +51,6 @@ internal static bool Contains(this StringBuilder stringBuilder, ReadOnlySpan<cha
return false;
}


/// <summary>
/// Converts the value of this instance to a <see langword="string"/>, then clears its buffer.
/// </summary>
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![.NET Unit Tests][.NET-Badge]][.NET-Url]
[![CodeQL][CodeQL-Badge]][CodeQL-Url]
[![CodeFactor][CodeFactor-Badge]][CodeFactor-Url]
[![NuGet Badge][Nuget-Badge]][Nuget-Url]
[![NuGet Nightly Badge][Nuget-Nightly-Badge]][Nuget-Url]

# Json2Sharp

Expand Down Expand Up @@ -126,4 +128,7 @@ limitations under the License.
[.NET-Url]: ../../actions/workflows/dotnet.yml
[.NET-Badge]: ../../actions/workflows/dotnet.yml/badge.svg
[CodeQL-Url]: ../../actions/workflows/codeql.yml
[CodeQL-Badge]: ../../actions/workflows/codeql.yml/badge.svg
[CodeQL-Badge]: ../../actions/workflows/codeql.yml/badge.svg
[Nuget-Badge]: https://img.shields.io/nuget/v/Json2Sharp.svg?label=NuGet
[Nuget-Nightly-Badge]: https://img.shields.io/nuget/vpre/Json2Sharp?color=00007f&label=NuGet%20Nightly
[Nuget-Url]: https://www.nuget.org/packages/Json2Sharp

0 comments on commit c4f4aa9

Please sign in to comment.