Skip to content

Commit

Permalink
Update RSPEC
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource committed Mar 10, 2025
1 parent 57a5e23 commit 1a2bf31
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
6 changes: 5 additions & 1 deletion rules/S1116/rust/metadata.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
{
}
"tags": [
"unused",
"clippy"
]
}
55 changes: 30 additions & 25 deletions rules/S1116/rust/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
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)

//=== What is the potential impact?

== How to fix it
//== How to fix it in FRAMEWORK NAME
include::../description.adoc[]

=== Code examples

==== Noncompliant code example

[source,rust,diff-id=1,diff-type=noncompliant]
----
FIXME
fn main() {
let x = 5;
if x > 0 {
println!("x is positive");
}; // Noncompliant
match x {
1 => println!("x is one"),
2 => println!("x is two"),
_ => println!("x is something else"),
}; // Noncompliant
}
----

==== Compliant solution

[source,rust,diff-id=1,diff-type=compliant]
----
FIXME
fn main() {
let x = 5;
if x > 0 {
println!("x is positive");
}
match x {
1 => println!("x is one"),
2 => println!("x is two"),
_ => println!("x is something else"),
}
}
----

//=== How does this work?

//=== Pitfalls

//=== Going the extra mile
== Resources

=== Documentation

//== Resources
//=== Documentation
//=== Articles & blog posts
//=== Conference presentations
//=== Standards
//=== External coding guidelines
//=== Benchmarks
* Clippy Lints - https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon

0 comments on commit 1a2bf31

Please sign in to comment.