diff --git a/rules/S1751/rust/metadata.json b/rules/S1751/rust/metadata.json index 7a73a41bfd..652f2cd52e 100644 --- a/rules/S1751/rust/metadata.json +++ b/rules/S1751/rust/metadata.json @@ -1,2 +1,7 @@ { -} \ No newline at end of file + "tags": [ + "confusing", + "bad-practice", + "clippy" + ] +} diff --git a/rules/S1751/rust/rule.adoc b/rules/S1751/rust/rule.adoc index 368fb2954e..269a3e29ef 100644 --- a/rules/S1751/rust/rule.adoc +++ b/rules/S1751/rust/rule.adoc @@ -1,44 +1,34 @@ -FIXME: add a description - -// If you want to factorize the description uncomment the following line and create the file. -//include::../description.adoc[] - == Why is this an issue? -FIXME: remove the unused optional headers (that are commented out) +include::../description.adoc[] -//=== What is the potential impact? - -== How to fix it -//== How to fix it in FRAMEWORK NAME - -=== Code examples - -==== Noncompliant code example +=== Noncompliant code example [source,rust,diff-id=1,diff-type=noncompliant] ---- -FIXME +let mut x = 0; +loop { + x += 1; + if x == 1 { + return; + } + break; +} ---- -==== Compliant solution +=== Compliant solution [source,rust,diff-id=1,diff-type=compliant] ---- -FIXME +let mut x = 0; +x += 1; +if x == 1 { + return; +} ---- -//=== How does this work? +== Resources -//=== Pitfalls +=== Documentation -//=== Going the extra mile - - -//== Resources -//=== Documentation -//=== Articles & blog posts -//=== Conference presentations -//=== Standards -//=== External coding guidelines -//=== Benchmarks +* Clippy Lints - https://rust-lang.github.io/rust-clippy/master/index.html#never_loop