#![warn(clippy::too_many_lines)]
-
// This function should be considered one line.
fn many_comments_but_one_line_of_code() {
/* println!("This is good."); */
}
// This should be considered one line.
+#[rustfmt::skip]
fn comment_starts_after_code() {
let _ = 5; /* closing comment. */ /*
this line shouldn't be counted theoretically.
}
// This should fail since it is technically two lines.
+#[rustfmt::skip]
fn comment_before_code() {
let _ = "test";
/* This comment extends to the front of
error: This function has a large number of lines.
- --> $DIR/test.rs:19:1
+ --> $DIR/test.rs:18:1
|
LL | / fn too_many_lines() {
LL | | println!("This is bad.");
= note: `-D clippy::too-many-lines` implied by `-D warnings`
error: This function has a large number of lines.
- --> $DIR/test.rs:37:1
+ --> $DIR/test.rs:38:1
|
LL | / fn comment_before_code() {
LL | | let _ = "test";