Skip to content

Commit c7e257c

Browse files
committed
cleanup
1 parent 7c8b0eb commit c7e257c

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

ModBrowser/GithubApi/GithubModSearchEngine.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66

77
namespace SporeCommunity.ModBrowser.GithubApi
88
{
9-
public class GithubModSearchEngine : IModSearchEngine
9+
/// <summary>
10+
/// Creates a new GitHub client for searching for Spore mods.
11+
/// </summary>
12+
/// <param name="userAgent">A User-Agent header. GitHub requires that you provide your GitHub username, or name of the application, so they can contact you if there are problems.</param>
13+
public class GithubModSearchEngine(string userAgent) : IModSearchEngine
1014
{
11-
private readonly GithubApiClient client;
12-
13-
/// <summary>
14-
/// Creates a new GitHub client for searching for Spore mods.
15-
/// </summary>
16-
/// <param name="userAgent">A User-Agent header. GitHub requires that you provide your GitHub username, or name of the application, so they can contact you if there are problems.</param>
17-
public GithubModSearchEngine(string userAgent)
18-
{
19-
client = new(userAgent);
20-
}
15+
private readonly GithubApiClient client = new(userAgent);
2116

2217
public async IAsyncEnumerable<ModListing> SearchModsAsync(string searchTerm = "")
2318
{
@@ -53,7 +48,7 @@ private async Task<IEnumerable<Repository>> SearchForSporeModRepositoriesAsync(s
5348
/// </summary>
5449
/// <param name="repository">The GitHub repository containing the Spore mod.</param>
5550
/// <returns>The Mod Listing for the Spore mod, or null if the repository does not contain a valid ModInfo.xml file.</returns>
56-
private async Task<ModListing?> GetModListingFromRepositoryAsync(Repository repository)
51+
private static async Task<ModListing?> GetModListingFromRepositoryAsync(Repository repository)
5752
{
5853
var modIdentity = await repository.GetModIdentityAsync();
5954

@@ -66,7 +61,7 @@ private async Task<IEnumerable<Repository>> SearchForSporeModRepositoriesAsync(s
6661
if(versionString is not null)
6762
{
6863
versionString = versionString.Replace("v", "").Trim();
69-
Version.TryParse(versionString, out version);
64+
_ = Version.TryParse(versionString, out version);
7065
}
7166

7267
if (modIdentity is null)

0 commit comments

Comments
 (0)