
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
33 lines
671 B
Plaintext
33 lines
671 B
Plaintext
== Why is this an issue?
|
|
|
|
If you're using a `struct`, it is likely because you're interested in performance. But by failing to implement `IEquatable<T>` you're loosing performance when comparisons are made because without `IEquatable<T>`, boxing and reflection are used to make comparisons.
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,csharp]
|
|
----
|
|
struct MyStruct // Noncompliant
|
|
{
|
|
public int Value { get; set; }
|
|
}
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,csharp]
|
|
----
|
|
struct MyStruct : IEquatable<MyStruct>
|
|
{
|
|
public int Value { get; set; }
|
|
|
|
public bool Equals(MyStruct other)
|
|
{
|
|
// ...
|
|
}
|
|
}
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
include::../rspecator.adoc[]
|