diff --git a/Cargo.toml b/Cargo.toml index c89299a8..f40bf22d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,6 +66,7 @@ unsafe_code = "forbid" [lints.clippy] explicit_iter_loop = "warn" needless_for_each = "warn" +semicolon_if_nothing_returned = "warn" [features] #! The crate provides a set of optional features that can be enabled in your `cargo.toml` file. diff --git a/src/backend/crossterm.rs b/src/backend/crossterm.rs index d8cc8e05..afbeb4f7 100644 --- a/src/backend/crossterm.rs +++ b/src/backend/crossterm.rs @@ -668,6 +668,6 @@ mod tests { ..Default::default() }), Style::default().underline_color(Color::Red) - ) + ); } } diff --git a/src/layout/layout.rs b/src/layout/layout.rs index 5364ea15..541f0bfd 100644 --- a/src/layout/layout.rs +++ b/src/layout/layout.rs @@ -733,7 +733,7 @@ fn configure_constraints( } } Constraint::Length(length) => { - solver.add_constraint(element.has_int_size(length, LENGTH_SIZE_EQ))? + solver.add_constraint(element.has_int_size(length, LENGTH_SIZE_EQ))?; } Constraint::Percentage(p) => { let size = area.size() * f64::from(p) / 100.00; @@ -776,7 +776,7 @@ fn configure_flex_constraints( // constraints are satisfied Flex::SpaceAround => { for (left, right) in spacers.iter().tuple_combinations() { - solver.add_constraint(left.has_size(right, SPACER_SIZE_EQ))? + solver.add_constraint(left.has_size(right, SPACER_SIZE_EQ))?; } for spacer in spacers { solver.add_constraint(spacer.has_min_size(spacing, SPACER_SIZE_EQ))?; @@ -788,7 +788,7 @@ fn configure_flex_constraints( // constraints are satisfied, but the first and last spacers are zero size Flex::SpaceBetween => { for (left, right) in spacers_except_first_and_last.iter().tuple_combinations() { - solver.add_constraint(left.has_size(right.size(), SPACER_SIZE_EQ))? + solver.add_constraint(left.has_size(right.size(), SPACER_SIZE_EQ))?; } for spacer in spacers_except_first_and_last { solver.add_constraint(spacer.has_min_size(spacing, SPACER_SIZE_EQ))?; @@ -1104,7 +1104,7 @@ mod tests { assert!(!Layout::init_cache(15)); LAYOUT_CACHE.with(|c| { assert_eq!(c.get().unwrap().borrow().cap().get(), 10); - }) + }); } #[test] @@ -1130,7 +1130,7 @@ mod tests { c.get().unwrap().borrow().cap().get(), Layout::DEFAULT_CACHE_SIZE ); - }) + }); } #[test] @@ -1406,7 +1406,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1449,7 +1449,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1485,7 +1485,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] // flex, width, lengths, expected @@ -1618,7 +1618,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1655,7 +1655,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1692,7 +1692,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1795,7 +1795,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1832,7 +1832,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[rstest] @@ -1869,7 +1869,7 @@ mod tests { #[case] constraints: &[Constraint], #[case] expected: &str, ) { - letters(flex, constraints, width, expected) + letters(flex, constraints, width, expected); } #[test] diff --git a/src/style.rs b/src/style.rs index af36886b..ebebd7e7 100644 --- a/src/style.rs +++ b/src/style.rs @@ -660,7 +660,7 @@ mod tests { .bg(Color::Black) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::ITALIC) - ) + ); } #[test] diff --git a/src/widgets.rs b/src/widgets.rs index daa3a641..5c8968fc 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -438,7 +438,7 @@ impl Widget for &str { /// [`Rect`]. impl WidgetRef for &str { fn render_ref(&self, area: Rect, buf: &mut Buffer) { - buf.set_string(area.x, area.y, self, crate::style::Style::default()) + buf.set_string(area.x, area.y, self, crate::style::Style::default()); } } @@ -459,7 +459,7 @@ impl Widget for String { /// without the need to give up ownership of the underlying text. impl WidgetRef for String { fn render_ref(&self, area: Rect, buf: &mut Buffer) { - buf.set_string(area.x, area.y, self, crate::style::Style::default()) + buf.set_string(area.x, area.y, self, crate::style::Style::default()); } } diff --git a/src/widgets/barchart.rs b/src/widgets/barchart.rs index 7b673b52..bfffd1a3 100644 --- a/src/widgets/barchart.rs +++ b/src/widgets/barchart.rs @@ -848,7 +848,7 @@ mod tests { .fg(Color::Black) .bg(Color::White) .add_modifier(Modifier::BOLD) - ) + ); } #[test] @@ -989,7 +989,7 @@ mod tests { #[test] fn test_horizontal_bars_label_width_greater_than_bar_with_style() { - test_horizontal_bars_label_width_greater_than_bar(Some(Color::White)) + test_horizontal_bars_label_width_greater_than_bar(Some(Color::White)); } /// Tests horizontal bars label are presents diff --git a/src/widgets/block.rs b/src/widgets/block.rs index 3acf09d6..04115b64 100644 --- a/src/widgets/block.rs +++ b/src/widgets/block.rs @@ -1126,7 +1126,7 @@ mod tests { style: Style::new(), padding: Padding::zero(), } - ) + ); } #[test] @@ -1198,7 +1198,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] diff --git a/src/widgets/block/padding.rs b/src/widgets/block/padding.rs index 5b4ae282..2bf36fc1 100644 --- a/src/widgets/block/padding.rs +++ b/src/widgets/block/padding.rs @@ -168,7 +168,7 @@ mod tests { top: 3, bottom: 4 } - ) + ); } #[test] diff --git a/src/widgets/chart.rs b/src/widgets/chart.rs index ced750bd..182b1db8 100644 --- a/src/widgets/chart.rs +++ b/src/widgets/chart.rs @@ -1151,7 +1151,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] @@ -1163,7 +1163,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] @@ -1175,7 +1175,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] @@ -1199,7 +1199,7 @@ mod tests { let mut buffer = Buffer::empty(Rect::new(0, 0, 8, 4)); widget.render(buffer.area, &mut buffer); - assert_eq!(buffer, Buffer::with_lines(vec![" ".repeat(8); 4])) + assert_eq!(buffer, Buffer::with_lines(vec![" ".repeat(8); 4])); } #[test] diff --git a/src/widgets/gauge.rs b/src/widgets/gauge.rs index 5b805e78..489516d8 100644 --- a/src/widgets/gauge.rs +++ b/src/widgets/gauge.rs @@ -457,7 +457,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] @@ -474,7 +474,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] diff --git a/src/widgets/list.rs b/src/widgets/list.rs index 83ba72b2..c91ea723 100755 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -1874,7 +1874,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] @@ -1886,7 +1886,7 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] diff --git a/src/widgets/paragraph.rs b/src/widgets/paragraph.rs index 1deb09ee..a4fd685d 100644 --- a/src/widgets/paragraph.rs +++ b/src/widgets/paragraph.rs @@ -952,7 +952,7 @@ mod test { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } #[test] diff --git a/src/widgets/reflow.rs b/src/widgets/reflow.rs index 65be9beb..673e1ee1 100644 --- a/src/widgets/reflow.rs +++ b/src/widgets/reflow.rs @@ -628,7 +628,7 @@ mod test { let (word_wrapper_space, word_wrapper_widths, _) = run_composer(Composer::WordWrapper { trim: true }, text_space, width); assert_eq!(word_wrapper_space, vec!["AAAAAAAAAAAAAAA AAAA", "AAA",]); - assert_eq!(word_wrapper_widths, vec![20, 3]) + assert_eq!(word_wrapper_widths, vec![20, 3]); } #[test] diff --git a/src/widgets/sparkline.rs b/src/widgets/sparkline.rs index 1d5c9737..8f393230 100644 --- a/src/widgets/sparkline.rs +++ b/src/widgets/sparkline.rs @@ -317,6 +317,6 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } } diff --git a/src/widgets/table/cell.rs b/src/widgets/table/cell.rs index 0d05cf68..83c5b858 100644 --- a/src/widgets/table/cell.rs +++ b/src/widgets/table/cell.rs @@ -195,6 +195,6 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::DIM) - ) + ); } } diff --git a/src/widgets/table/row.rs b/src/widgets/table/row.rs index ddad81bf..74ae4d5b 100644 --- a/src/widgets/table/row.rs +++ b/src/widgets/table/row.rs @@ -319,6 +319,6 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::ITALIC) - ) + ); } } diff --git a/src/widgets/table/table.rs b/src/widgets/table/table.rs index d640ad89..9658c7ad 100644 --- a/src/widgets/table/table.rs +++ b/src/widgets/table/table.rs @@ -1370,7 +1370,7 @@ mod tests { assert_eq!( table.get_columns_widths(30, 0), &[(0, 10), (10, 10), (20, 10)] - ) + ); } #[test] @@ -1379,7 +1379,7 @@ mod tests { .rows(vec![]) .header(Row::new(vec!["f", "g"])) .column_spacing(0); - assert_eq!(table.get_columns_widths(10, 0), [(0, 5), (5, 5)]) + assert_eq!(table.get_columns_widths(10, 0), [(0, 5), (5, 5)]); } #[test] @@ -1388,7 +1388,7 @@ mod tests { .rows(vec![]) .footer(Row::new(vec!["h", "i"])) .column_spacing(0); - assert_eq!(table.get_columns_widths(10, 0), [(0, 5), (5, 5)]) + assert_eq!(table.get_columns_widths(10, 0), [(0, 5), (5, 5)]); } fn test_table_with_selection( @@ -1787,6 +1787,6 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::CROSSED_OUT) - ) + ); } } diff --git a/src/widgets/tabs.rs b/src/widgets/tabs.rs index 2b67cd14..837ca215 100755 --- a/src/widgets/tabs.rs +++ b/src/widgets/tabs.rs @@ -511,6 +511,6 @@ mod tests { .bg(Color::White) .add_modifier(Modifier::BOLD) .remove_modifier(Modifier::ITALIC) - ) + ); } }