Skip to content

Commit

Permalink
fix: clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Aug 16, 2024
1 parent 3215332 commit e04d897
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/bin/generate-cli-docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
let target_default_platform = format!("Default value: `{}`", Platform::current());
let help = help.replace(
target_default_platform.as_str(),
format!("Default value: current platform").as_str(),
"Default value: current platform",
);

print!("{}", help);
Expand Down
27 changes: 12 additions & 15 deletions src/tui/render.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
use super::event::Event;
use super::state::TuiState;
use ansi_to_tui::IntoText;
use crossterm::event::{
Event as CrosstermEvent, KeyCode, KeyEvent, KeyModifiers, MouseButton, MouseEvent,
MouseEventKind,
};
use miette::IntoDiagnostic;
use ratatui::layout::Position;
use ratatui::prelude::*;
use ratatui::style::Stylize;
use ratatui::widgets::{Scrollbar, ScrollbarOrientation, ScrollbarState};
use ratatui::{
layout::Alignment,
style::{Color, Style},
widgets::{Block, BorderType, Paragraph},
layout::{Alignment, Position},
prelude::*,
style::{Color, Style, Stylize},
widgets::{Block, BorderType, Paragraph, Scrollbar, ScrollbarOrientation, ScrollbarState},
Frame,
};
use tokio::sync::mpsc;
use tui_input::backend::crossterm::EventHandler;

use super::{event::Event, state::TuiState};

/// Key bindings.
const KEY_BINDINGS: &[(&str, &str)] = &[
("⏎ ", "Build"),
Expand Down Expand Up @@ -263,12 +260,12 @@ pub(crate) fn render_widgets(state: &mut TuiState, frame: &mut Frame) {
package.name.clone().into(),
"-".fg(Color::Rgb(100, 100, 100)),
package.version.clone().into(),
package
.build_string
.clone()
.map(|v| format!("{}{v}", "-".fg(Color::Rgb(100, 100, 100))))
.unwrap_or_default()
.into(),
format!(
"{}{}",
"-".fg(Color::Rgb(100, 100, 100)),
&package.build_string
)
.into(),
]);
if item[1].width < line.width() as u16 {
line = Line::from(vec![
Expand Down
4 changes: 2 additions & 2 deletions src/tui/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
pub struct Package {
pub name: String,
pub version: String,
pub build_string: Option<String>,
pub build_string: String,
pub subpackages: Vec<String>,
pub build_progress: BuildProgress,
pub build_log: Vec<String>,
Expand All @@ -33,7 +33,7 @@ impl Package {
Package {
name: name.clone(),
version: output.version().to_string(),
build_string: output.build_string().map(String::from),
build_string: output.build_string().into_owned(),
subpackages: output
.build_configuration
.subpackages
Expand Down

0 comments on commit e04d897

Please sign in to comment.