mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 18:14:11 +02:00
clippy fixes
This commit is contained in:
parent
b8af91acd7
commit
29e57dd6e3
4 changed files with 6 additions and 10 deletions
|
|
@ -132,10 +132,7 @@ fn group_lines<I: Iterator<Item = usize>>(all_lines: &[LogLine], indices: I) ->
|
|||
map.entry(line.identity()).or_default().push(i);
|
||||
}
|
||||
|
||||
let mut list: Vec<_> = map
|
||||
.into_values()
|
||||
.map(|lines| GroupedLines::new(lines))
|
||||
.collect();
|
||||
let mut list: Vec<_> = map.into_values().map(GroupedLines::new).collect();
|
||||
list.sort_by_key(|list| list.len());
|
||||
list.reverse();
|
||||
list
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ impl<'a> SingleMatchState<'a> {
|
|||
#[test]
|
||||
fn test_matcher() {
|
||||
use crate::logfile::logline::Exception;
|
||||
use crate::logfile::LogIndex;
|
||||
use std::str::FromStr;
|
||||
use time::OffsetDateTime;
|
||||
use tinystr::TinyAsciiStr;
|
||||
|
|
@ -333,7 +334,7 @@ fn test_matcher() {
|
|||
message: "Not allowed to rename a shared album".into(),
|
||||
exception: None,
|
||||
time: OffsetDateTime::now_utc(),
|
||||
index: 0,
|
||||
index: LogIndex::from(0),
|
||||
method: TinyAsciiStr::from_str("GET").unwrap(),
|
||||
remote: TinyAsciiStr::from_str("1.2.3.4").unwrap(),
|
||||
user: TinyAsciiStr::from_str("user").unwrap(),
|
||||
|
|
@ -406,7 +407,7 @@ fn test_matcher() {
|
|||
message: "".into(),
|
||||
exception: "Bar\\FooException".into(),
|
||||
file: "short".into(),
|
||||
line: 68,
|
||||
line: LineNumber::from(68),
|
||||
}),
|
||||
..default_log.clone()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ fn ui(frame: &mut Frame, app: &App, state: &mut UiState) {
|
|||
&result.grouped[selected - 1]
|
||||
};
|
||||
|
||||
frame.render_widget(UiHistogram::new(&selected_group.histogram(app)), layout[0]);
|
||||
frame.render_widget(UiHistogram::new(selected_group.histogram(app)), layout[0]);
|
||||
frame.render_stateful_widget(
|
||||
grouped_lines(app, result, filter),
|
||||
layout[1],
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
use crate::app::{App, Filter, GroupedLines, LogMatch};
|
||||
use crate::ui::grouped_logs::GroupedLogs;
|
||||
use crate::ui::state::GroupedLogGrouping;
|
||||
use crate::ui::style::TABLE_HEADER_STYLE;
|
||||
use crate::ui::table::{ScrollbarTable, ScrollbarTableState};
|
||||
use ratatui::buffer::Buffer;
|
||||
|
|
@ -18,7 +16,7 @@ pub fn grouped_lines<'a>(
|
|||
SingleMatchTable {
|
||||
app,
|
||||
log_match,
|
||||
filter
|
||||
filter,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue