mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
pedantic clippy
This commit is contained in:
parent
77cafbd6b7
commit
bc85a86000
4 changed files with 10 additions and 8 deletions
|
|
@ -89,7 +89,9 @@ impl ChangesComponent {
|
|||
i = cmp::min(i + delta, max - 1);
|
||||
i = cmp::max(i, 0);
|
||||
|
||||
self.selection = Some(i as usize);
|
||||
if let Ok(i) = usize::try_from(i) {
|
||||
self.selection = Some(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
};
|
||||
use asyncgit::{hash, Diff, DiffLine, DiffLineType};
|
||||
use crossterm::event::{Event, KeyCode};
|
||||
use std::{borrow::Cow, cmp};
|
||||
use std::{borrow::Cow, cmp, convert::TryFrom};
|
||||
use tui::{
|
||||
backend::Backend,
|
||||
layout::{Alignment, Rect},
|
||||
|
|
@ -82,7 +82,7 @@ impl DiffComponent {
|
|||
break;
|
||||
}
|
||||
|
||||
let hunk_len = hunk.0.len() as u16;
|
||||
let hunk_len = u16::try_from(hunk.0.len()).unwrap();
|
||||
let hunk_min = line_cursor;
|
||||
let hunk_max = line_cursor + hunk_len;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#![forbid(unsafe_code)]
|
||||
#![deny(clippy::all)]
|
||||
// #![warn(clippy::cargo)]
|
||||
#![deny(clippy::cast_possible_wrap)]
|
||||
#![deny(clippy::pedantic)]
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
|
||||
mod app;
|
||||
mod components;
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ pub static CMD_STATUS_UNSTAGE: &str = "Unstage File [enter]";
|
|||
pub static CMD_STATUS_RESET: &str = "Reset File [D]";
|
||||
pub static CMD_STATUS_QUIT: &str = "Quit [esc,q]";
|
||||
pub static CMD_STATUS_HELP: &str = "Help [h]";
|
||||
pub static CMD_STATUS_LEFT: &str = "Back [←]";
|
||||
pub static CMD_STATUS_RIGHT: &str = "Diff [→]";
|
||||
pub static CMD_STATUS_LEFT: &str = "Back [\u{2190}]"; //←
|
||||
pub static CMD_STATUS_RIGHT: &str = "Diff [\u{2192}]"; //→
|
||||
pub static CMD_SPLITTER: &str = " ";
|
||||
pub static CMD_SCROLL: &str = "Scroll [↑↓]";
|
||||
pub static CMD_SCROLL: &str = "Scroll [\u{2191}\u{2193}]"; //↑↓
|
||||
|
||||
pub static COMMIT_TITLE: &str = "Commit";
|
||||
pub static COMMIT_MSG: &str = "type commit message..";
|
||||
|
|
|
|||
Loading…
Reference in a new issue