Skip to content

Commit

Permalink
Fixes clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandesh Grangdan committed Jan 20, 2025
1 parent d4b72d1 commit d8038e5
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ssm-tui"
version = "0.1.2"
version = "0.1.3"
edition = "2021"

# Github Repo
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ This project serves as a learning exercise in [Rust](https://www.rust-lang.org/)

### Install prebuilt binaries via shell script (Linux, macOS)
```bash
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/sandeshgrangdan/ssm-tui/releases/download/v0.1.0/ssm-tui-installer.sh | sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/sandeshgrangdan/ssm-tui/releases/download/v0.1.3/ssm-tui-installer.sh | sh
```

### Install prebuilt binaries via powershell script (Windows)
```bash
powershell -c "irm https://github.com/sandeshgrangdan/ssm-tui/releases/download/v0.1.0/ssm-tui-installer.ps1 | iex"
powershell -c "irm https://github.com/sandeshgrangdan/ssm-tui/releases/download/v0.1.3/ssm-tui-installer.ps1 | iex"
```

### Cargo
Expand Down
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use clap::Parser;
use rand::Rng;

use crate::ui::widgets::state_fullist::StatefulList;
use input::input::{
use input::user_input::{
InputMode::{self, Editing, Normal},
UserInput,
};
Expand Down Expand Up @@ -131,7 +131,7 @@ mod tests {
fn toggle_search() {
let mut app = App::new(Args::parse());
app.toggle_search();
assert!(app.filter_ps_list);
assert!(app.search.0);
}

#[test]
Expand Down
8 changes: 4 additions & 4 deletions src/app/aws/parameter_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use aws_sdk_ssm::{
use ratatui::text::Line;

use crate::app::App;
use crate::app::{aws, input::input::InputMode};
use crate::app::{aws, input::user_input::InputMode};

// ANCHOR: application
#[derive(Debug, Clone)]
Expand All @@ -30,7 +30,7 @@ pub enum SsmClient {

#[derive(Debug)]
pub enum PsMetadata {
Data(ParameterMetadata),
Data(Box<ParameterMetadata>),
None,
}

Expand Down Expand Up @@ -243,7 +243,7 @@ pub async fn get_ps_metadata(parameter_name: &str, client: &Client) -> PsMetadat
for data in metadatas {
if let Some(name) = &data.name {
if *name == *parameter_name {
result = PsMetadata::Data(data);
result = PsMetadata::Data(Box::new(data));
break;
}
}
Expand Down Expand Up @@ -402,7 +402,7 @@ impl App {
if let aws::parameter_store::PsMetadata::Data(data) =
aws::parameter_store::get_ps_metadata(ps_name, client).await
{
self.parameter_stores.ps_metadata[index] = data;
self.parameter_stores.ps_metadata[index] = *data;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/input/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod input;
pub mod user_input;
File renamed without changes.
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ async fn main() -> Result<()> {

// Handle events.

if let Ok(event) = my_event::read() {
if let my_event::Event::Key(key_event) = event {
update(&mut app, key_event, &mut tui).await
}
if let Ok(my_event::Event::Key(key_event)) = my_event::read() {
update(&mut app, key_event, &mut tui).await
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui_block/add_ps.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::app::{input::input::InputMode, App};
use crate::app::{input::user_input::InputMode, App};

use aws_sdk_ssm::types::{ParameterTier, ParameterType};
use ratatui::{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui_block/delete_ps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ratatui::{
widgets::{Block, BorderType, Borders, Padding, Paragraph},
};

use crate::app::{aws::parameter_store::SelectedPsMetadata, input::input::InputMode, App};
use crate::app::{aws::parameter_store::SelectedPsMetadata, input::user_input::InputMode, App};

fn center(area: Rect, percent_x: usize) -> Rect {
let [area] = Layout::horizontal([Constraint::Percentage(percent_x as u16)])
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ui_block/search.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::app::input::input::InputMode;
use crate::app::input::user_input::InputMode;
use crate::app::App;
use ratatui::{
prelude::*,
Expand Down
2 changes: 1 addition & 1 deletion src/update.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use aws_sdk_ssm::types::{ParameterTier, ParameterType};
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers};

use crate::app::input::input::{InputMode, UserInput};
use crate::app::input::user_input::{InputMode, UserInput};
use crate::app::{App, SelectedTab};
use crate::tui::Tui;

Expand Down

0 comments on commit d8038e5

Please sign in to comment.