Compare commits

...

2 Commits

Author SHA1 Message Date
yassin-kammoun-sonarsource
d23e6f1e6f Update RSPEC 2025-03-25 13:36:48 +01:00
yassin-kammoun-sonarsource
7bac0febbf Add rust to rule S1751 2025-03-25 12:30:36 +00:00
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,7 @@
{
"tags": [
"confusing",
"bad-practice",
"clippy"
]
}

View File

@ -0,0 +1,34 @@
== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
[source,rust,diff-id=1,diff-type=noncompliant]
----
let mut x = 0;
loop {
x += 1;
if x == 1 {
return;
}
break;
}
----
=== Compliant solution
[source,rust,diff-id=1,diff-type=compliant]
----
let mut x = 0;
x += 1;
if x == 1 {
return;
}
----
== Resources
=== Documentation
* Clippy Lints - https://rust-lang.github.io/rust-clippy/master/index.html#never_loop