diff --git a/src/EmbeddedResource.cs b/src/EmbeddedResource.cs index c738ef09..a6a96c3e 100644 --- a/src/EmbeddedResource.cs +++ b/src/EmbeddedResource.cs @@ -40,12 +40,8 @@ public static Stream GetStream(string relativePath) if (string.IsNullOrEmpty(manifestResourceName)) throw new InvalidOperationException($"Did not find required resource ending in '{resourceName}' in assembly '{baseName}'."); - var stream = Assembly.GetExecutingAssembly() - .GetManifestResourceStream(manifestResourceName); - - if (stream == null) + return + Assembly.GetExecutingAssembly().GetManifestResourceStream(manifestResourceName) ?? throw new InvalidOperationException($"Did not find required resource '{manifestResourceName}' in assembly '{baseName}'."); - - return stream; } } \ No newline at end of file diff --git a/src/ThisAssembly.Constants/ConstantsGenerator.cs b/src/ThisAssembly.Constants/ConstantsGenerator.cs index 67791578..7cdfd9ff 100644 --- a/src/ThisAssembly.Constants/ConstantsGenerator.cs +++ b/src/ThisAssembly.Constants/ConstantsGenerator.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text;