Skip to content

Commit 94f9136

Browse files
committed
Use target-new constructors
1 parent 7ce3ee8 commit 94f9136

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/PuppeteerSharp/LauncherBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public LauncherBase(string executable, LaunchOptions options)
7474
/// </summary>
7575
public bool HasExited => _stateManager.CurrentState.IsExited;
7676

77-
internal TaskCompletionSource<bool> ExitCompletionSource { get; } = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
77+
internal TaskCompletionSource<bool> ExitCompletionSource { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously);
7878

79-
internal TaskCompletionSource<string> StartCompletionSource { get; } = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously);
79+
internal TaskCompletionSource<string> StartCompletionSource { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously);
8080

8181
internal LaunchOptions Options { get; }
8282

lib/PuppeteerSharp/Payload.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Payload
3030
/// Gets or sets the HTTP headers.
3131
/// </summary>
3232
/// <value>HTTP headers.</value>
33-
public Dictionary<string, string> Headers { get; set; } = new Dictionary<string, string>();
33+
public Dictionary<string, string> Headers { get; set; } = new();
3434

3535
/// <summary>
3636
/// Gets or sets the URL.

lib/PuppeteerSharp/PdfOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public PdfOptions()
7979
/// <summary>
8080
/// Paper margins, defaults to none.
8181
/// </summary>
82-
public MarginOptions MarginOptions { get; set; } = new MarginOptions();
82+
public MarginOptions MarginOptions { get; set; } = new();
8383

8484
/// <summary>
8585
/// Give any CSS <c>@page</c> size declared in the page priority over what is declared in <c>width</c> and <c>height</c> or <c>format</c> options.

lib/PuppeteerSharp/Target.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ internal Target(
100100

101101
internal Task<bool> InitializedTask => InitializedTaskWrapper.Task;
102102

103-
internal TaskCompletionSource<bool> InitializedTaskWrapper { get; } = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
103+
internal TaskCompletionSource<bool> InitializedTaskWrapper { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously);
104104

105105
internal Task CloseTask => CloseTaskWrapper.Task;
106106

lib/PuppeteerSharp/TaskManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace PuppeteerSharp
66
{
77
internal class TaskManager
88
{
9-
private ConcurrentSet<WaitTask> WaitTasks { get; } = new ConcurrentSet<WaitTask>();
9+
private ConcurrentSet<WaitTask> WaitTasks { get; } = new();
1010

1111
internal void Add(WaitTask waitTask) => WaitTasks.Add(waitTask);
1212

0 commit comments

Comments
 (0)