Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
seryj committed Jul 26, 2023
1 parent a3a460b commit a30c4bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
20 changes: 5 additions & 15 deletions src/app/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,15 @@ pub struct Tabs {
pub index: usize,
}

#[derive(Debug, Copy, Eq, PartialEq, Clone)]
#[derive(Default, Debug, Copy, Eq, PartialEq, Clone)]
pub enum TabItem {
#[default]
Editor,
QueryHistory,
Context,
Logs,
}

impl Default for TabItem {
fn default() -> TabItem {
TabItem::Editor
}
}

impl TabItem {
pub(crate) fn all_values() -> Vec<TabItem> {
vec![
Expand All @@ -68,7 +63,7 @@ impl TabItem {
}

pub(crate) fn title_with_key(&self) -> String {
return format!("{} [{}]", self.title(), self.list_index() + 1);
format!("{} [{}]", self.title(), self.list_index() + 1)
}

pub(crate) fn title(&self) -> &'static str {
Expand Down Expand Up @@ -109,19 +104,14 @@ impl From<TabItem> for usize {
}
}

#[derive(Debug, Copy, Clone)]
#[derive(Default, Debug, Copy, Clone)]
pub enum InputMode {
#[default]
Normal,
Editing,
Rc,
}

impl Default for InputMode {
fn default() -> InputMode {
InputMode::Normal
}
}

/// Status that determines whether app should continue or exit
#[derive(PartialEq)]
pub enum AppReturn {
Expand Down
2 changes: 1 addition & 1 deletion src/app/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Input {
self.current_row - MAX_EDITOR_LINES
} as usize;

let end = (start + (MAX_EDITOR_LINES as usize) + 1) as usize;
let end = start + (MAX_EDITOR_LINES as usize) + 1;

let text: Vec<&str> = if start == 0 {
// debug!("Combining all lines");
Expand Down
12 changes: 6 additions & 6 deletions src/cli/print_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ mod tests {
let batch = RecordBatch::try_new(
schema,
vec![
Arc::new(Int32Array::from_slice(&[1, 2, 3])),
Arc::new(Int32Array::from_slice(&[4, 5, 6])),
Arc::new(Int32Array::from_slice(&[7, 8, 9])),
Arc::new(Int32Array::from_slice([1, 2, 3])),
Arc::new(Int32Array::from_slice([4, 5, 6])),
Arc::new(Int32Array::from_slice([7, 8, 9])),
],
)
.unwrap();
Expand Down Expand Up @@ -137,9 +137,9 @@ mod tests {
let batch = RecordBatch::try_new(
schema,
vec![
Arc::new(Int32Array::from_slice(&[1, 2, 3])),
Arc::new(Int32Array::from_slice(&[4, 5, 6])),
Arc::new(Int32Array::from_slice(&[7, 8, 9])),
Arc::new(Int32Array::from_slice([1, 2, 3])),
Arc::new(Int32Array::from_slice([4, 5, 6])),
Arc::new(Int32Array::from_slice([7, 8, 9])),
],
)
.unwrap();
Expand Down

0 comments on commit a30c4bd

Please sign in to comment.