Skip to content

Commit c0e7204

Browse files
authored
Quick cleanup: Address compiler hints (#836)
1 parent 0e11be6 commit c0e7204

File tree

24 files changed

+18
-37
lines changed

24 files changed

+18
-37
lines changed

src/Elastic.Markdown/BuildContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System.IO.Abstractions;
66
using Elastic.Markdown.Diagnostics;
7-
using Elastic.Markdown.Extensions;
87
using Elastic.Markdown.IO;
98
using Elastic.Markdown.IO.Configuration;
109
using Elastic.Markdown.IO.Discovery;

src/Elastic.Markdown/Extensions/DetectionRules/DetectionRule.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Diagnostics.CodeAnalysis;
65
using System.IO.Abstractions;
76
using Tomlet;
87
using Tomlet.Models;
@@ -82,7 +81,7 @@ public static DetectionRule From(IFileInfo source)
8281
throw new Exception($"Could not parse toml in: {source.FullName}", e);
8382
}
8483

85-
if (!model.TryGetValue("metadata", out var node) || node is not TomlTable metadata)
84+
if (!model.TryGetValue("metadata", out var node) || node is not TomlTable)
8685
throw new Exception($"Could not find metadata section in {source.FullName}");
8786

8887
if (!model.TryGetValue("rule", out node) || node is not TomlTable rule)

src/Elastic.Markdown/Extensions/DetectionRules/DetectionRulesDocsBuilderExtension.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System.IO.Abstractions;
66
using Elastic.Markdown.Exporters;
7-
using Elastic.Markdown.Helpers;
87
using Elastic.Markdown.IO;
98
using Elastic.Markdown.IO.Configuration;
109
using Elastic.Markdown.IO.Navigation;

src/Elastic.Markdown/Helpers/Htmx.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information
44

55
using System.Text;
6-
using Elastic.Markdown.IO.Configuration;
76

87
namespace Elastic.Markdown.Helpers;
98

src/Elastic.Markdown/Helpers/Preloader.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Collections.Immutable;
6-
using System.Diagnostics;
75
using System.Reflection;
86
using System.Text.RegularExpressions;
97

108
namespace Elastic.Markdown.Helpers;
119

1210
public static partial class FontPreloader
1311
{
14-
private static IReadOnlyCollection<string>? FontUriCache = null!;
12+
private static IReadOnlyCollection<string>? FontUriCache;
1513

1614
public static async Task<IReadOnlyCollection<string>> GetFontUrisAsync(string? urlPrefix) => FontUriCache ??= await LoadFontUrisAsync(urlPrefix);
1715
private static async Task<IReadOnlyCollection<string>> LoadFontUrisAsync(string? urlPrefix)

src/Elastic.Markdown/Myst/CodeBlocks/CodeBlockArguments.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System.Collections.Immutable;
65
using System.Diagnostics.CodeAnalysis;
7-
using Elastic.Markdown.Diagnostics;
86

97
namespace Elastic.Markdown.Myst.CodeBlocks;
108

src/Elastic.Markdown/Myst/CodeBlocks/EnhancedCodeBlockHtmlRenderer.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,7 @@ private static int CountIndentation(StringSlice slice)
108108
return indentCount;
109109
}
110110

111-
private static bool IsCommentBlock(Block block)
112-
{
113-
if (block is CommentBlock)
114-
{
115-
return true;
116-
}
117-
return false;
118-
}
111+
private static bool IsCommentBlock(Block block) => block is CommentBlock;
119112

120113
protected override void Write(HtmlRenderer renderer, EnhancedCodeBlock block)
121114
{

src/Elastic.Markdown/Myst/MarkdownParser.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System.IO.Abstractions;
66
using Cysharp.IO;
7-
using Elastic.Markdown.IO.Configuration;
87
using Elastic.Markdown.Myst.CodeBlocks;
98
using Elastic.Markdown.Myst.Comments;
109
using Elastic.Markdown.Myst.Directives;

src/Elastic.Markdown/Myst/Renderers/HtmxLinkInlineRenderer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using Elastic.Markdown.Helpers;
66
using Elastic.Markdown.IO;
7-
using Elastic.Markdown.IO.Configuration;
87
using Elastic.Markdown.IO.Navigation;
98
using Markdig;
109
using Markdig.Renderers;

src/Elastic.Markdown/Slices/Layout/_Header.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ else
1010
<header class="sticky top-0 z-50 bg-blue-developer text-white text-lg font-semibold h-(--offset-top) flex items-center px-6">
1111
<div class="container mx-auto">
1212
<div class="flex justify-between items-center">
13+
@* ReSharper disable once Html.IdNotResolved *@
1314
<label role="button" class="md:hidden cursor-pointer" for="pages-nav-hamburger">
1415
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-8">
1516
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"/>

0 commit comments

Comments
 (0)