rspec/rules/S6613/vbnet/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

43 lines
855 B
Plaintext

include::../why-dotnet.adoc[]
include::../impact-dotnet.adoc[]
include::../how-dotnet.adoc[]
=== Code examples
==== Noncompliant code example
[source,vbnet,diff-id=1,diff-type=noncompliant]
----
Function GetFirst(data As LinkedList(Of Integer)) As Integer
Return Enumerable.First(data)
End Function
----
[source,vbnet,diff-id=2,diff-type=noncompliant]
----
Function GetLast(data As LinkedList(Of Integer)) As Integer
Return Enumerable.Last(data)
End Function
----
==== Compliant solution
[source,vbnet,diff-id=1,diff-type=compliant]
----
Function GetFirst(data As LinkedList(Of Integer)) As Integer
Return data.First.Value
End Function
----
[source,vbnet,diff-id=2,diff-type=compliant]
----
Function GetLast(data As LinkedList(Of Integer)) As Integer
Return data.Last.Value
End Function
----
include::../resources-dotnet.adoc[]