Skip to content

Commit 5bcde2e

Browse files
committed
Remove unused using directives and update nullability checks in various services
1 parent 5019872 commit 5bcde2e

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

ByteMeBackup/Core/BackupTask.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
using System.IO;
31
using System.IO.Compression;
42
using ByteMeBackup.Configuration;
53
using ByteMeBackup.Services;
@@ -138,7 +136,7 @@ await LogAsync($"""
138136
}
139137
}
140138

141-
private async Task LogAsync(string message, string consoleMarkup = null)
139+
private async Task LogAsync(string message, string consoleMarkup = null!)
142140
{
143141
if (!string.IsNullOrWhiteSpace(consoleMarkup))
144142
AnsiConsole.Markup(consoleMarkup + "\n");

ByteMeBackup/Services/ConfigService.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.IO;
31
using System.Text.Json;
4-
using System.Threading.Tasks;
52
using ByteMeBackup.Configuration;
63
using Spectre.Console;
74

ByteMeBackup/Services/DiscordWebhookLogService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public DiscordWebhookLogService(ConfigService configService)
1818
public async Task SendLogAsync(string message)
1919
{
2020
var config = ConfigService.Get();
21-
if (string.IsNullOrEmpty(config.DiscordWebhookUrl))
21+
if (string.IsNullOrEmpty(config!.DiscordWebhookUrl))
2222
{
2323
AnsiConsole.Markup("[red]Discord webhook URL is not configured![/]\n");
2424
return;

ByteMeBackup/Startup.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Threading.Tasks;
21
using ByteMeBackup.Configuration;
32
using ByteMeBackup.Services;
43
using Spectre.Console;
@@ -7,7 +6,6 @@ namespace ByteMeBackup;
76

87
public class Startup
98
{
10-
private static ConfigService ConfigService;
119
private static AppConfig? Config;
1210

1311
public static async Task Main()
@@ -18,7 +16,7 @@ public static async Task Main()
1816

1917
AnsiConsole.Markup("[bold white]Starting ByteMeBackup...[/]\n");
2018

21-
if (Config.BackupConfigs.Length == 0)
19+
if (Config!.BackupConfigs.Length == 0)
2220
{
2321
AnsiConsole.Markup("[red]No backup configurations found! Please check your config.json file.[/]\n");
2422
return;

0 commit comments

Comments
 (0)