mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-10 13:22:24 +00:00
Use nullable
This commit is contained in:
@@ -16,9 +16,9 @@ namespace DiscordChatExporter.Core.Markdown.Internal
|
||||
{
|
||||
}
|
||||
|
||||
public ParsedMatch<T> Match(StringPart stringPart)
|
||||
public ParsedMatch<T>? Match(StringPart stringPart)
|
||||
{
|
||||
ParsedMatch<T> earliestMatch = null;
|
||||
ParsedMatch<T>? earliestMatch = null;
|
||||
|
||||
// Try to match the input with each matcher and get the match with the lowest start index
|
||||
foreach (var matcher in _matchers)
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
{
|
||||
internal interface IMatcher<T>
|
||||
{
|
||||
ParsedMatch<T> Match(StringPart stringPart);
|
||||
ParsedMatch<T>? Match(StringPart stringPart);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace DiscordChatExporter.Core.Markdown.Internal
|
||||
@@ -23,7 +19,7 @@ namespace DiscordChatExporter.Core.Markdown.Internal
|
||||
{
|
||||
}
|
||||
|
||||
public ParsedMatch<T> Match(StringPart stringPart)
|
||||
public ParsedMatch<T>? Match(StringPart stringPart)
|
||||
{
|
||||
var match = _regex.Match(stringPart.Target, stringPart.StartIndex, stringPart.Length);
|
||||
if (!match.Success)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace DiscordChatExporter.Core.Markdown.Internal
|
||||
{
|
||||
}
|
||||
|
||||
public ParsedMatch<T> Match(StringPart stringPart)
|
||||
public ParsedMatch<T>? Match(StringPart stringPart)
|
||||
{
|
||||
var index = stringPart.Target.IndexOf(_needle, stringPart.StartIndex, stringPart.Length, _comparison);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user