Skip to content

Commit 05650ce

Browse files
committed
Remove struct default construct
1 parent 6b718d4 commit 05650ce

File tree

8 files changed

+11
-38
lines changed

8 files changed

+11
-38
lines changed

AdvancedSharpAdbClient.Tests/Models/DeviceDataTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ public void EqualityTest(string data, string serial, string product, string mode
230230
Model = model,
231231
Name = name,
232232
TransportId = transportId,
233-
State = DeviceState.Online
233+
State = DeviceState.Online,
234+
Usb = string.Empty,
235+
Features = [],
236+
Message = string.Empty
234237
};
235238

236239
Assert.True(d1 == d2);

AdvancedSharpAdbClient/DeviceCommands/Models/AndroidProcess.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ namespace AdvancedSharpAdbClient.DeviceCommands.Models
1111
/// </summary>
1212
public readonly struct AndroidProcess
1313
{
14-
/// <summary>
15-
/// Initializes a new instance of the <see cref="AndroidProcess"/> struct.
16-
/// </summary>
17-
public AndroidProcess() { }
18-
1914
/// <summary>
2015
/// Initializes a new instance of the <see cref="AndroidProcess"/> struct from it <see cref="string"/> representation.
2116
/// </summary>
2217
/// <param name="line">A <see cref="string"/> which represents a <see cref="AndroidProcess"/>.</param>
2318
/// <param name="cmdLinePrefix">A value indicating whether the output of <c>/proc/{pid}/stat</c> is prefixed with <c>/proc/{pid}/cmdline</c> or not.
2419
/// Because <c>stat</c> does not contain the full process name, this can be useful.</param>
25-
public AndroidProcess(string line, bool cmdLinePrefix = false) : this()
20+
public AndroidProcess(string line, bool cmdLinePrefix = false)
2621
{
2722
ExceptionExtensions.ThrowIfNull(line);
2823

AdvancedSharpAdbClient/DeviceMonitor.Async.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,6 @@ private async Task InitializeSocketAsync(CancellationToken cancellationToken)
249249
[EditorBrowsable(EditorBrowsableState.Never)]
250250
private readonly struct ThreadSwitcher : INotifyCompletion
251251
{
252-
/// <summary>
253-
/// Initializes a new instance of the <see cref="ThreadSwitcher"/> struct.
254-
/// </summary>
255-
public ThreadSwitcher() { }
256-
257252
/// <summary>
258253
/// Gets a value that indicates whether the asynchronous operation has completed.
259254
/// </summary>

AdvancedSharpAdbClient/Models/ColorData.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ public readonly record struct ColorData(uint Offset, uint Length) : IReadOnlyLis
3232
/// </summary>
3333
private const int count = 8;
3434

35-
/// <summary>
36-
/// Initializes a new instance of the <see cref="ColorData"/> struct.
37-
/// </summary>
38-
public ColorData() : this(0, 0) { }
39-
4035
/// <summary>
4136
/// Gets or sets the offset, in bits, within the byte array for a pixel, at which the
4237
/// bytes that contain information for this color are stored.

AdvancedSharpAdbClient/Models/DeviceData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace AdvancedSharpAdbClient.Models
3333
/// data retrieved from the Android Debug Bridge.
3434
/// </summary>
3535
/// <param name="data">The data retrieved from the Android Debug Bridge that represents a device.</param>
36-
public DeviceData(string data) : this()
36+
public DeviceData(string data)
3737
{
3838
Match match = Regex.Match(data);
3939
if (match.Success)

AdvancedSharpAdbClient/Models/ForwardData.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ namespace AdvancedSharpAdbClient.Models
1414
[DebuggerDisplay($"{nameof(AdbServerStatus)} \\{{ {nameof(SerialNumber)} = {{{nameof(SerialNumber)}}}, {nameof(LocalSpec)} = {{{nameof(LocalSpec)}}}, {nameof(RemoteSpec)} = {{{nameof(RemoteSpec)}}} }}")]
1515
public readonly struct ForwardData : IEquatable<ForwardData>
1616
{
17-
/// <summary>
18-
/// Initializes a new instance of the <see cref="ForwardData"/> struct.
19-
/// </summary>
20-
public ForwardData() { }
21-
2217
/// <summary>
2318
/// Initializes a new instance of the <see cref="ForwardData"/> struct.
2419
/// </summary>
2520
/// <param name="serialNumber">The serial number of the device for which the port forwarding is configured.</param>
2621
/// <param name="local">The <see cref="string"/> that represents the local (PC) endpoint.</param>
2722
/// <param name="remote">The <see cref="string"/> that represents the remote (device) endpoint.</param>
28-
public ForwardData(string serialNumber, string local, string remote) : this()
23+
public ForwardData(string serialNumber, string local, string remote)
2924
{
3025
SerialNumber = serialNumber;
3126
Local = local;
@@ -36,7 +31,7 @@ public ForwardData(string serialNumber, string local, string remote) : this()
3631
/// Initializes a new instance of the <see cref="ForwardData"/> class by parsing a <see cref="string"/>.
3732
/// </summary>
3833
/// <param name="value">The <see cref="string"/> value to parse.</param>
39-
public ForwardData(string value) : this()
34+
public ForwardData(string value)
4035
{
4136
string[] parts = value.Split(' ');
4237
SerialNumber = parts[0];

AdvancedSharpAdbClient/Models/ForwardSpec.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@ namespace AdvancedSharpAdbClient.Models
3131
{ "jdwp", ForwardProtocol.JavaDebugWireProtocol }
3232
};
3333

34-
/// <summary>
35-
/// Initializes a new instance of the <see cref="ForwardSpec"/> struct.
36-
/// </summary>
37-
public ForwardSpec() { }
38-
3934
/// <summary>
4035
/// Initializes a new instance of the <see cref="ForwardSpec"/> struct from its <see cref="string"/> representation.
4136
/// </summary>
4237
/// <param name="spec">A <see cref="string"/> which represents a <see cref="ForwardSpec"/>.</param>
43-
public ForwardSpec(string spec) : this()
38+
public ForwardSpec(string spec)
4439
{
4540
ExceptionExtensions.ThrowIfNull(spec);
4641

AdvancedSharpAdbClient/Models/FramebufferHeader.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,12 @@ namespace AdvancedSharpAdbClient.Models
3838
/// </summary>
3939
public const int MiniLength = 52;
4040

41-
/// <summary>
42-
/// Initializes a new instance of the <see cref="FramebufferHeader"/> struct.
43-
/// </summary>
44-
public FramebufferHeader() { }
45-
4641
/// <summary>
4742
/// Initializes a new instance of the <see cref="FramebufferHeader"/> struct based on a byte array which contains the data.
4843
/// </summary>
4944
/// <param name="data">The data that feeds the <see cref="FramebufferHeader"/> struct.</param>
5045
/// <remarks>As defined in <see href="https://android.googlesource.com/platform/system/core/+/master/adb/framebuffer_service.cpp"/></remarks>
51-
public FramebufferHeader(byte[] data) : this()
46+
public FramebufferHeader(byte[] data)
5247
{
5348
if (data.Length is < MiniLength or > MaxLength)
5449
{
@@ -102,7 +97,7 @@ public FramebufferHeader(byte[] data) : this()
10297
/// </summary>
10398
/// <param name="data">The data that feeds the <see cref="FramebufferHeader"/> struct.</param>
10499
/// <remarks>As defined in <see href="https://android.googlesource.com/platform/system/core/+/master/adb/framebuffer_service.cpp"/></remarks>
105-
public FramebufferHeader(ReadOnlySpan<byte> data) : this()
100+
public FramebufferHeader(ReadOnlySpan<byte> data)
106101
{
107102
if (data.Length is < MiniLength or > MaxLength)
108103
{

0 commit comments

Comments
 (0)