Skip to content

Commit

Permalink
Fix new clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
YS-L committed May 18, 2024
1 parent 4b229fe commit dd85d40
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use anyhow::{Context, Result};
use regex::Regex;
use std::cmp::min;
use std::sync::Arc;
use std::usize;

fn get_offsets_to_make_visible(
found_record: &find::FoundRecord,
Expand Down Expand Up @@ -193,7 +192,6 @@ impl App {
rows_view.headers().len(),
&echo_column,
ignore_case,
no_headers,
);

let finder: Option<find::Finder> = None;
Expand Down Expand Up @@ -608,7 +606,9 @@ impl App {

self.csv_table_state.update_sorter(&self.sorter);

self.csv_table_state.transient_message = self.transient_message.clone();
self.csv_table_state
.transient_message
.clone_from(&self.transient_message);

// self.csv_table_state.debug = format!("{:?}", self.sorter);

Expand Down
3 changes: 0 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,6 @@ pub struct CsvTableState {
pub transient_message: Option<String>,
pub echo_column: Option<String>,
pub ignore_case: bool,
pub no_headers: bool,
pub view_layout: Option<ViewLayout>,
pub enable_line_wrap: bool,
pub is_word_wrap: bool,
Expand All @@ -1054,7 +1053,6 @@ impl CsvTableState {
total_cols: usize,
echo_column: &Option<String>,
ignore_case: bool,
no_headers: bool,
) -> Self {
Self {
rows_offset: 0,
Expand All @@ -1075,7 +1073,6 @@ impl CsvTableState {
transient_message: None,
echo_column: echo_column.clone(),
ignore_case,
no_headers,
view_layout: None,
enable_line_wrap: false,
is_word_wrap: false,
Expand Down
4 changes: 1 addition & 3 deletions src/util/events.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::{Duration, Instant};

use crossterm::event::{poll, read, Event, KeyCode, KeyEvent, KeyEventKind};
use crossterm::event::{poll, read, Event, KeyEvent, KeyEventKind};

pub enum CsvlensEvent<I> {
Input(I),
Expand All @@ -15,14 +15,12 @@ pub struct CsvlensEvents {

#[derive(Debug, Clone, Copy)]
pub struct Config {
pub exit_key: KeyCode,
pub tick_rate: Duration,
}

impl Default for Config {
fn default() -> Config {
Config {
exit_key: KeyCode::Char('q'),
tick_rate: Duration::from_millis(250),
}
}
Expand Down

0 comments on commit dd85d40

Please sign in to comment.