Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant type specs #1419

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi.Hidi/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static IList<string> SplitByChar(this string target, char separator)
{
return new List<string>();
}
return target.Split(new char[] { separator }, StringSplitOptions.RemoveEmptyEntries).ToList();
return target.Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries).ToList();
}
}
}
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Any/OpenApiByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class OpenApiByte : OpenApiPrimitive<byte[]>
/// Initializes the <see cref="OpenApiByte"/> class.
/// </summary>
public OpenApiByte(byte value)
: this(new byte[] { value })
: this(new[] { value })
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void InvokeTransformCommand()
{
var rootCommand = Program.CreateRootCommand();
var openapi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
var args = new string[] { "transform", "-d", openapi, "-o", "sample.json", "--co" };
var args = new[] { "transform", "-d", openapi, "-o", "sample.json", "--co" };
var parseResult = rootCommand.Parse(args);
var handler = rootCommand.Subcommands.Where(c => c.Name == "transform").First().Handler;
var context = new InvocationContext(parseResult);
Expand All @@ -339,7 +339,7 @@ public void InvokeShowCommand()
{
var rootCommand = Program.CreateRootCommand();
var openApi = Path.Combine(".", "UtilityFiles", "SampleOpenApi.yml");
var args = new string[] { "show", "-d", openApi, "-o", "sample.md" };
var args = new[] { "show", "-d", openApi, "-o", "sample.md" };
var parseResult = rootCommand.Parse(args);
var handler = rootCommand.Subcommands.Where(c => c.Name == "show").First().Handler;
var context = new InvocationContext(parseResult);
Expand All @@ -355,7 +355,7 @@ public void InvokePluginCommand()
{
var rootCommand = Program.CreateRootCommand();
var manifest = Path.Combine(".", "UtilityFiles", "exampleapimanifest.json");
var args = new string[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
var args = new[] { "plugin", "-m", manifest, "--of", AppDomain.CurrentDomain.BaseDirectory };
var parseResult = rootCommand.Parse(args);
var handler = rootCommand.Subcommands.Where(c => c.Name == "plugin").First().Handler;
var context = new InvocationContext(parseResult);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public class OpenApiJsonWriterTests
public static IEnumerable<object[]> WriteStringListAsJsonShouldMatchExpectedTestCases()
{
return
from input in new string[][] {
from input in new[]
{
new[]
{
"string1",
Expand Down Expand Up @@ -234,7 +235,7 @@ public void WriteMapAsJsonShouldMatchExpected(IDictionary<string, object> inputM
public static IEnumerable<object[]> WriteDateTimeAsJsonTestCases()
{
return
from input in new DateTimeOffset[] {
from input in new[] {
new(2018, 1, 1, 10, 20, 30, TimeSpan.Zero),
new(2018, 1, 1, 10, 20, 30, 100, TimeSpan.FromHours(14)),
DateTimeOffset.UtcNow + TimeSpan.FromDays(4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static IEnumerable<object[]> IntInputs
get
{
return
from input in new int[] {
from input in new[] {
int.MinValue,
42,
int.MaxValue,
Expand Down Expand Up @@ -68,7 +68,7 @@ public static IEnumerable<object[]> LongInputs
get
{
return
from input in new long[] {
from input in new[] {
long.MinValue,
42,
long.MaxValue,
Expand Down Expand Up @@ -96,7 +96,7 @@ public static IEnumerable<object[]> FloatInputs
get
{
return
from input in new float[] {
from input in new[] {
float.MinValue,
42.42f,
float.MaxValue,
Expand Down Expand Up @@ -124,7 +124,7 @@ public static IEnumerable<object[]> DoubleInputs
get
{
return
from input in new double[] {
from input in new[] {
double.MinValue,
42.42d,
double.MaxValue,
Expand Down
Loading