mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-29 17:23:04 +00:00
C#10ify
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
using System.IO;
|
||||
|
||||
namespace DiscordChatExporter.Cli.Tests.Utils
|
||||
{
|
||||
internal static class DirectoryEx
|
||||
{
|
||||
public static void DeleteIfExists(string dirPath, bool recursive = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete(dirPath, recursive);
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
}
|
||||
}
|
||||
namespace DiscordChatExporter.Cli.Tests.Utils;
|
||||
|
||||
public static void Reset(string dirPath)
|
||||
internal static class DirectoryEx
|
||||
{
|
||||
public static void DeleteIfExists(string dirPath, bool recursive = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.Delete(dirPath, recursive);
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
DeleteIfExists(dirPath);
|
||||
Directory.CreateDirectory(dirPath);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Reset(string dirPath)
|
||||
{
|
||||
DeleteIfExists(dirPath);
|
||||
Directory.CreateDirectory(dirPath);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
using AngleSharp.Html.Dom;
|
||||
using AngleSharp.Html.Parser;
|
||||
|
||||
namespace DiscordChatExporter.Cli.Tests.Utils
|
||||
{
|
||||
internal static class Html
|
||||
{
|
||||
private static readonly IHtmlParser Parser = new HtmlParser();
|
||||
namespace DiscordChatExporter.Cli.Tests.Utils;
|
||||
|
||||
public static IHtmlDocument Parse(string source) => Parser.ParseDocument(source);
|
||||
}
|
||||
internal static class Html
|
||||
{
|
||||
private static readonly IHtmlParser Parser = new HtmlParser();
|
||||
|
||||
public static IHtmlDocument Parse(string source) => Parser.ParseDocument(source);
|
||||
}
|
||||
Reference in New Issue
Block a user