Skip to content

Commit 4b6ad38

Browse files
committed
chore: clear clippy warning
1 parent 8952b35 commit 4b6ad38

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/app/data.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ mod data_iter;
1414
pub mod filter;
1515

1616
type LogRowIdxFieldName<'a> = Option<&'a String>;
17+
type RowSlice<'a> = &'a [(String, String)];
1718

1819
#[derive(serde::Deserialize, serde::Serialize, Default, Debug, PartialEq, Eq)]
1920
#[serde(default)]
@@ -69,7 +70,7 @@ impl LogRow {
6970
}
7071
}
7172

72-
pub fn as_slice(&mut self, common_fields: &BTreeSet<String>) -> &[(String, String)] {
73+
pub fn as_slice(&mut self, common_fields: &BTreeSet<String>) -> RowSlice<'_> {
7374
self.ensure_cache_is_populated(common_fields);
7475

7576
&self
@@ -160,7 +161,7 @@ impl Data {
160161
pub fn selected_row_data_as_slice(
161162
&mut self,
162163
common_fields: &BTreeSet<String>,
163-
) -> Option<&[(String, String)]> {
164+
) -> Option<RowSlice<'_>> {
164165
let selected_row_index = self.selected_row?;
165166
let real_index = self.get_real_index(selected_row_index);
166167
Some(self.rows[real_index].as_slice(common_fields))
@@ -169,7 +170,7 @@ impl Data {
169170
pub fn selected_row_data_as_slice_with_filter_matching_fields(
170171
&mut self,
171172
common_fields: &BTreeSet<String>,
172-
) -> Option<(&[(String, String)], Vec<usize>)> {
173+
) -> Option<(RowSlice<'_>, Vec<usize>)> {
173174
// Collect other needed info before taking mutable borrow to appease the borrow checker (couldn't find another readable way)
174175
let is_filtered = self.is_filtered();
175176
let filter = if is_filtered {
@@ -287,10 +288,7 @@ impl Data {
287288
}
288289

289290
/// If the slice of fields and values matches the filter then the indices of the fields that match are returned or None if it does not match
290-
fn matching_fields(
291-
fields_and_values: &[(String, String)],
292-
filter: &FilterConfig,
293-
) -> Option<Vec<usize>> {
291+
fn matching_fields(fields_and_values: RowSlice<'_>, filter: &FilterConfig) -> Option<Vec<usize>> {
294292
let FilterConfig {
295293
search_key,
296294
filter_on,

0 commit comments

Comments
 (0)