Skip to content

Commit

Permalink
refactor: clippy::too_many_lines (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo authored and joshka committed Mar 4, 2024
1 parent e3afe7c commit c8c7924
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -81,6 +81,7 @@ needless_for_each = "warn"
needless_pass_by_value = "warn"
return_self_not_must_use = "warn"
semicolon_if_nothing_returned = "warn"
too_many_lines = "warn"
trivially_copy_pass_by_ref = "warn"
unreadable_literal = "warn"
use_self = "warn"
Expand Down
1 change: 1 addition & 0 deletions src/style.rs
Expand Up @@ -663,6 +663,7 @@ mod tests {
);
}

#[allow(clippy::too_many_lines)]
#[test]
fn style_can_be_stylized() {
// foreground colors
Expand Down
1 change: 1 addition & 0 deletions src/widgets/block.rs
Expand Up @@ -874,6 +874,7 @@ mod tests {
assert_eq!(block.borders, Borders::all());
}

#[allow(clippy::too_many_lines)]
#[test]
fn inner_takes_into_account_the_borders() {
// No borders
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/chart.rs
Expand Up @@ -924,6 +924,7 @@ impl Widget for Chart<'_> {
}

impl WidgetRef for Chart<'_> {
#[allow(clippy::too_many_lines)]
fn render_ref(&self, area: Rect, buf: &mut Buffer) {
buf.set_style(area, self.style);

Expand Down Expand Up @@ -1370,6 +1371,7 @@ mod tests {
}
}

#[allow(clippy::too_many_lines)]
#[test]
fn test_legend_of_chart_have_odd_margin_size() {
let name = "Data";
Expand Down
1 change: 1 addition & 0 deletions src/widgets/list.rs
Expand Up @@ -1243,6 +1243,7 @@ mod tests {
);
}

#[allow(clippy::too_many_lines)]
#[test]
fn test_list_combinations() {
fn test_case_render(items: &[ListItem], expected_lines: Vec<&str>) {
Expand Down
1 change: 1 addition & 0 deletions src/widgets/reflow.rs
Expand Up @@ -65,6 +65,7 @@ where
O: Iterator<Item = (I, Alignment)>,
I: Iterator<Item = StyledGrapheme<'a>>,
{
#[allow(clippy::too_many_lines)]
fn next_line<'lend>(&'lend mut self) -> Option<WrappedLine<'lend, 'a>> {
if self.max_line_width == 0 {
return None;
Expand Down
1 change: 1 addition & 0 deletions src/widgets/table/table.rs
Expand Up @@ -1516,6 +1516,7 @@ mod tests {
);
}

#[allow(clippy::too_many_lines)]
#[test]
fn insufficient_area_highlight_symbol_and_column_spacing_allocation() {
// column spacing is prioritized over every other constraint
Expand Down

0 comments on commit c8c7924

Please sign in to comment.