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 CommandLine;
using Image;
using Image.Files; using Image.Files;
using Image.Output; using Image.Output;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -20,7 +20,8 @@ namespace ConsoleInterface
/// The console interface for the project and the main entrypoint. /// The console interface for the project and the main entrypoint.
/// </summary> /// </summary>
/// <param name="args">Command line provided args.</param> /// <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); Parser.Default.ParseArguments<Options>(args).WithParsed(RunOptions);
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -36,7 +36,7 @@ namespace Image.Output
{ {
Logger.LogDebug($"KeepFilenameFormatter - {_outputDirectory} - {initialFilePath}"); Logger.LogDebug($"KeepFilenameFormatter - {_outputDirectory} - {initialFilePath}");
Guard.Against.NullOrEmpty(initialFilePath, nameof(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"); var path = Path.Combine(_outputDirectory, $"{fileName}.jpg");
return path; return path;