Handle compiler warnings.

This commit is contained in:
Denis-Cosmin Nutiu 2022-01-27 23:22:10 +02:00
parent b43deb9cb8
commit 101d9edb15
8 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,6 @@
using System.IO;
using System.Collections.Generic;
using System.IO;
using CommandLine;
using Image;
using Image.Files;
using Image.Output;
using Microsoft.Extensions.Logging;
@ -20,7 +20,8 @@ namespace ConsoleInterface
/// The console interface for the project and the main entrypoint.
/// </summary>
/// <param name="args">Command line provided args.</param>
private static void Main(string[] args)
// ReSharper disable once UnusedMember.Local
private static void Main(IEnumerable<string> args)
{
Parser.Default.ParseArguments<Options>(args).WithParsed(RunOptions);
}

View file

@ -91,7 +91,7 @@ namespace ConsoleInterface
result.Wait();
var successTasks = tasks.Count(t => t.IsCompletedSuccessfully && t.Result);
var errorTasks = tasks.Count() - successTasks;
var errorTasks = tasks.Count - successTasks;
Logger.LogInformation($"All tasks completed. Success: {successTasks}, Errors: {errorTasks}");
}
}

View file

@ -1,6 +1,5 @@
using System;
using System.IO;
using Image;
using Image.Compressor;
using Xunit;

View file

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Image;
using Image.Files;
using Xunit;

View file

@ -7,7 +7,7 @@ namespace Image.Compressor
/// </summary>
public class LosslessCompressor : ICompressor
{
public static readonly LosslessCompressor Instance;
public static readonly LosslessCompressor Instance = new LosslessCompressor();
private readonly ImageOptimizer _imageOptimizer;
public LosslessCompressor()

View file

@ -5,7 +5,7 @@
/// </summary>
public class NullCompressor : ICompressor
{
public static readonly NullCompressor Instance;
public static readonly NullCompressor Instance = new NullCompressor();
/// <summary>
/// <inheritdoc />

View file

@ -3,6 +3,7 @@
<PropertyGroup>
<RootNamespace>Image</RootNamespace>
<TargetFrameworks>net5.0;netstandard2.1</TargetFrameworks>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>

View file

@ -36,7 +36,7 @@ namespace Image.Output
{
Logger.LogDebug($"KeepFilenameFormatter - {_outputDirectory} - {initialFilePath}");
Guard.Against.NullOrEmpty(initialFilePath, nameof(initialFilePath));
var fileName = Path.GetFileName(initialFilePath)?.Split('.')[0];
var fileName = Path.GetFileName(initialFilePath).Split('.')[0];
var path = Path.Combine(_outputDirectory, $"{fileName}.jpg");
return path;