Filter empty lines, comments and delimiters from previous to last multiline span rendering

This commit is contained in:
Esteban Küber 2024-12-11 21:48:33 +00:00
parent f4db5f7bab
commit cc9d9ccd11
29 changed files with 4 additions and 69 deletions

View file

@ -20,7 +20,6 @@ LL | | fn clone_self(&self) -> Self {
LL | | Self {
LL | | a: true,
... |
LL | | }
LL | | }
| |_^
|
@ -32,7 +31,6 @@ LL | | fn default() -> Self {
LL | | Self {
LL | | a: true,
... |
LL | | }
LL | | }
| |_^

View file

@ -286,7 +286,6 @@ LL | | if unsafe { true } {
LL | | todo!();
LL | | } else {
... |
LL | | }
LL | | };
| |______^
|

View file

@ -294,7 +294,6 @@ LL | | if unsafe { true } {
LL | | todo!();
LL | | } else {
... |
LL | | }
LL | | };
| |______^
|

View file

@ -44,7 +44,6 @@ LL | | if {
LL | | if s == "43" {
LL | | return Some(43);
... |
LL | | }
LL | | });
| |______^
|

View file

@ -44,7 +44,6 @@ LL | } else {
LL | | if y == "world" {
LL | | println!("world")
... |
LL | | }
LL | | }
| |_____^
|
@ -66,7 +65,6 @@ LL | } else {
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
... |
LL | | }
LL | | }
| |_____^
|
@ -88,7 +86,6 @@ LL | } else {
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
... |
LL | | }
LL | | }
| |_____^
|
@ -110,7 +107,6 @@ LL | } else {
LL | | if x == "hello" {
LL | | println!("world")
... |
LL | | }
LL | | }
| |_____^
|
@ -132,7 +128,6 @@ LL | } else {
LL | | if let Some(42) = Some(42) {
LL | | println!("world")
... |
LL | | }
LL | | }
| |_____^
|

View file

@ -6,7 +6,6 @@ LL | |
LL | |
LL | | type Item = u8;
... |
LL | | }
LL | | }
| |_^
|

View file

@ -3,7 +3,6 @@ error: this loop never actually loops
|
LL | / loop {
... |
LL | |
LL | | }
| |_____^
|
@ -14,7 +13,6 @@ error: this loop could be written as a `while let` loop
|
LL | / loop {
... |
LL | |
LL | | }
| |_____^ help: try: `while let Some(ele) = iter.next() { .. }`
|

View file

@ -6,7 +6,6 @@ LL | | fn default() -> Self {
LL | | Self {
LL | | a: false,
... |
LL | | }
LL | | }
| |_^
|

View file

@ -97,7 +97,6 @@ error: empty lines after doc comment
|
LL | / /// for OldA
... |
LL | | // struct OldB;
LL | |
| |_^
...

View file

@ -16,8 +16,7 @@ LL | / if !m.contains_key(&k) {
LL | | if true {
LL | | m.insert(k, v);
LL | | } else {
LL | | m.insert(k, v2);
LL | | }
... |
LL | | }
| |_____^
|
@ -63,7 +62,6 @@ LL | | if true {
LL | | m.insert(k, v);
LL | | } else {
... |
LL | | }
LL | | }
| |_____^
|
@ -154,7 +152,6 @@ LL | | foo();
LL | | match 0 {
LL | | 0 if false => {
... |
LL | | }
LL | | }
| |_____^
|

View file

@ -45,7 +45,6 @@ LL | / enum Food {
LL | |
LL | | FoodGood,
... |
LL | |
LL | | }
| |_^
|

View file

@ -29,7 +29,6 @@ LL | |
LL | | fn from(i: usize) -> Invalid {
LL | | if i != 42 {
... |
LL | | }
LL | | }
| |_^
|
@ -49,7 +48,6 @@ LL | |
LL | | fn from(s: Option<String>) -> Invalid {
LL | | let s = s.unwrap();
... |
LL | | }
LL | | }
| |_^
|
@ -76,7 +74,6 @@ LL | |
LL | | fn from(s: &'a mut <Box<u32> as ProjStrTrait>::ProjString) -> Invalid {
LL | | if s.parse::<u32>().ok().unwrap() != 42 {
... |
LL | | }
LL | | }
| |_^
|

View file

@ -7,7 +7,6 @@ LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
LL | | if foo.is_some() {
... |
LL | | }
LL | | } else {
| |_____^
|
@ -20,7 +19,6 @@ LL | | for _ in &[42] {
LL | | let bar: &Option<_> = &Some::<u8>(42);
LL | | if bar.is_some() {
... |
LL | | }
LL | | }
| |_____^
= note: `-D clippy::if-same-then-else` implied by `-D warnings`

View file

@ -37,7 +37,6 @@ LL | / loop {
LL | |
LL | | loop {
... |
LL | | }
LL | | }
| |_________^
|
@ -94,7 +93,6 @@ LL | |
LL | | loop {
LL | | if cond {
... |
LL | | }
LL | | }
| |_____^
|
@ -111,7 +109,6 @@ LL | |
LL | | 'inner: loop {
LL | | loop {
... |
LL | | }
LL | | }
| |_____^
|
@ -142,7 +139,6 @@ LL | |
LL | | 'inner: loop {
LL | | loop {
... |
LL | | }
LL | | }
| |_________^
|
@ -159,7 +155,6 @@ LL | |
LL | | match opt {
LL | | Some(v) => {
... |
LL | | }
LL | | }
| |_____^
|
@ -276,7 +271,6 @@ LL | |
LL | | 'inner: loop {
LL | | loop {
... |
LL | | }
LL | | }
| |_____^
|

View file

@ -6,7 +6,6 @@ LL | |
LL | | type IntoIter = std::slice::Iter<'a, u8>;
LL | | type Item = &'a u8;
... |
LL | | }
LL | | }
| |_^
|
@ -30,7 +29,6 @@ LL | |
LL | | type IntoIter = std::slice::IterMut<'a, u8>;
LL | | type Item = &'a mut u8;
... |
LL | | }
LL | | }
| |_^
|
@ -52,7 +50,6 @@ LL | |
LL | | type IntoIter = std::slice::Iter<'a, T>;
LL | | type Item = &'a T;
... |
LL | | }
LL | | }
| |_^
|
@ -74,7 +71,6 @@ LL | |
LL | | type IntoIter = std::slice::IterMut<'a, T>;
LL | | type Item = &'a mut T;
... |
LL | | }
LL | | }
| |_^
|
@ -96,7 +92,6 @@ LL | |
LL | | type IntoIter = std::slice::IterMut<'a, T>;
LL | | type Item = &'a mut T;
... |
LL | | }
LL | | }
| |_^
|
@ -117,8 +112,7 @@ LL | / impl<'a> IntoIterator for &'a Issue12037 {
LL | | type IntoIter = std::slice::Iter<'a, u8>;
LL | | type Item = &'a u8;
LL | | fn into_iter(self) -> Self::IntoIter {
LL | | todo!()
LL | | }
... |
LL | | }
| |_________^
...

View file

@ -6,7 +6,6 @@ LL | |
LL | |
LL | | if s == String::new() {
... |
LL | | }
LL | | None
| |________^ help: replace with an iterator: `strings.into_iter().find(|s| s == String::new())`
|
@ -22,7 +21,6 @@ LL | |
LL | |
LL | | if s == String::new() {
... |
LL | | }
LL | | None
| |________^ help: replace with an iterator: `arr.into_iter().map(|(s, _)| s).find(|s| s == String::new())`
|

View file

@ -184,7 +184,6 @@ LL | |
LL | | Some(1),
LL | | Some(2),
... |
LL | | }
LL | | }
| |_____^
|

View file

@ -148,7 +148,6 @@ LL | |
LL | | v_some
LL | | } else {
... |
LL | | }
LL | | };
| |______^
|
@ -175,7 +174,6 @@ LL | |
LL | | v_some
LL | | } else {
... |
LL | | }
LL | | };
| |______^
|
@ -197,7 +195,6 @@ LL | |
LL | | v_some
LL | | } else {
... |
LL | | }
LL | | };
| |______^
|
@ -306,7 +303,6 @@ LL | |
LL | | v_some
LL | | } else {
... |
LL | | }
LL | | };
| |______^
|

View file

@ -36,7 +36,6 @@ LL | | Some(i) => i,
LL | | None => {
LL | | 42 + 42
... |
LL | | }
LL | | };
| |_____^
|
@ -130,7 +129,6 @@ LL | | Ok(i) => i,
LL | | Err(_) => {
LL | | 42 + 42
... |
LL | | }
LL | | };
| |_____^
|

View file

@ -72,7 +72,6 @@ LL | | /// dox
LL | | pub fn documented() {}
LL | | pub fn undocumented1() {}
... |
LL | | }
LL | | }
| |_^

View file

@ -6,7 +6,6 @@ LL | |
LL | | // unused field: hidden
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
... |
LL | | }
LL | | }
| |_^
|
@ -28,7 +27,6 @@ LL | |
LL | | // unused fields: hidden, hidden2, hidden4
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
... |
LL | | }
LL | | }
| |_^
|
@ -58,7 +56,6 @@ LL | |
LL | | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
LL | | let mut f = formatter.debug_struct("MultiExprDebugImpl");
... |
LL | | }
LL | | }
| |_^
|

View file

@ -6,7 +6,6 @@ LL | |
LL | |
LL | | if *v == 10 {
... |
LL | | }
LL | | });
| |_______^
|

View file

@ -72,7 +72,6 @@ LL | |
LL | | // never loops
LL | | match x {
... |
LL | | }
LL | | }
| |_____^
|
@ -123,7 +122,6 @@ LL | |
LL | | 'b: {
LL | | break 'b 'c: {
... |
LL | | }
LL | | }
| |_____^

View file

@ -68,8 +68,7 @@ LL | / match Result::<i32, &Infallible>::Ok(1) {
LL | | Ok(a) => println!("${:?}", a),
LL | | Err(_) => {
LL | | println!("else block");
LL | | return;
LL | | }
... |
LL | | }
| |_____^
|
@ -88,8 +87,7 @@ LL | / match Cow::from("moo") {
LL | | Cow::Owned(a) => println!("${:?}", a),
LL | | Cow::Borrowed(_) => {
LL | | println!("else block");
LL | | return;
LL | | }
... |
LL | | }
| |_____^
|

View file

@ -34,7 +34,6 @@ LL | |
LL | | {
LL | | true;
... |
LL | | }
LL | | );
| |_____^
@ -46,7 +45,6 @@ LL | |
LL | | {
LL | | true;
... |
LL | | }
LL | | );
| |_____^
@ -58,7 +56,6 @@ LL | |
LL | | {
LL | | true;
... |
LL | | }
LL | | );
| |_____^
@ -70,7 +67,6 @@ LL | |
LL | | {
LL | | true;
... |
LL | | }
LL | | );
| |_____^

View file

@ -435,7 +435,6 @@ error: unnecessary closure used to substitute value for `Result::Err`
LL | let _: Result<usize, usize> = res.
| ___________________________________^
... |
LL | | // some lines
LL | | or_else(|_| Ok(ext_str.some_field));
| |_______________________________________^
|

View file

@ -6,7 +6,6 @@ LL | |
LL | |
LL | | if a && b {
... |
LL | | }
LL | | }
| |_^
|
@ -112,7 +111,6 @@ LL | |
LL | | if a && b {
LL | | return Some(());
... |
LL | | }
LL | | }
| |_^
|
@ -139,7 +137,6 @@ LL | |
LL | | if a && b {
LL | | return Ok(());
... |
LL | | }
LL | | }
| |_^
|

View file

@ -6,7 +6,6 @@ LL | |
LL | | // checks whether a string represents a number divisible by 3
LL | | let i = i_str.parse::<i32>().unwrap();
... |
LL | | }
LL | | }
| |_____^
|

View file

@ -6,7 +6,6 @@ LL | |
LL | |
LL | | if let Some(_x) = y {
... |
LL | | }
LL | | }
| |_____^ help: try: `while let Some(_x) = y { .. }`
|
@ -45,7 +44,6 @@ LL | |
LL | | let x = match y {
LL | | Some(x) => x,
... |
LL | | }
LL | | }
| |_____^ help: try: `while let Some(x) = y { .. }`