mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
clippy fixes
This commit is contained in:
parent
7407d46557
commit
4df7704ef5
2 changed files with 4 additions and 4 deletions
|
|
@ -173,7 +173,7 @@ pub fn get_diff(repo_path: &str, p: String, stage: bool) -> FileDiff {
|
|||
repo_path.join(delta.new_file().path().unwrap());
|
||||
|
||||
let newfile_content = new_file_content(&newfile_path)
|
||||
.unwrap_or(String::from("file not found"));
|
||||
.unwrap_or_else(|| String::from("file not found"));
|
||||
|
||||
let mut patch = Patch::from_buffers(
|
||||
&[],
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ impl ChangesComponent {
|
|||
match &item.kind {
|
||||
FileTreeItemKind::File(status_item) => {
|
||||
let status_char =
|
||||
Self::item_status_char(&status_item.status);
|
||||
Self::item_status_char(status_item.status);
|
||||
let file = Path::new(&status_item.path)
|
||||
.file_name()
|
||||
.unwrap()
|
||||
|
|
@ -182,7 +182,7 @@ impl ChangesComponent {
|
|||
w = width as usize
|
||||
)
|
||||
} else {
|
||||
format!("{} {}{}", status_char, indent_str, file) //M + - R
|
||||
format!("{} {}{}", status_char, indent_str, file)
|
||||
};
|
||||
|
||||
let mut style =
|
||||
|
|
@ -239,7 +239,7 @@ impl ChangesComponent {
|
|||
}
|
||||
}
|
||||
|
||||
fn item_status_char(item_type: &Option<StatusItemType>) -> char {
|
||||
fn item_status_char(item_type: Option<StatusItemType>) -> char {
|
||||
if let Some(item_type) = item_type {
|
||||
match item_type {
|
||||
StatusItemType::Modified => 'M',
|
||||
|
|
|
|||
Loading…
Reference in a new issue