Skip to content

Commit 4df7704

Browse files
author
Stephan Dilly
committed
clippy fixes
1 parent 7407d46 commit 4df7704

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

asyncgit/src/sync/diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub fn get_diff(repo_path: &str, p: String, stage: bool) -> FileDiff {
173173
repo_path.join(delta.new_file().path().unwrap());
174174

175175
let newfile_content = new_file_content(&newfile_path)
176-
.unwrap_or(String::from("file not found"));
176+
.unwrap_or_else(|| String::from("file not found"));
177177

178178
let mut patch = Patch::from_buffers(
179179
&[],

src/components/changes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl ChangesComponent {
166166
match &item.kind {
167167
FileTreeItemKind::File(status_item) => {
168168
let status_char =
169-
Self::item_status_char(&status_item.status);
169+
Self::item_status_char(status_item.status);
170170
let file = Path::new(&status_item.path)
171171
.file_name()
172172
.unwrap()
@@ -182,7 +182,7 @@ impl ChangesComponent {
182182
w = width as usize
183183
)
184184
} else {
185-
format!("{} {}{}", status_char, indent_str, file) //M + - R
185+
format!("{} {}{}", status_char, indent_str, file)
186186
};
187187

188188
let mut style =
@@ -239,7 +239,7 @@ impl ChangesComponent {
239239
}
240240
}
241241

242-
fn item_status_char(item_type: &Option<StatusItemType>) -> char {
242+
fn item_status_char(item_type: Option<StatusItemType>) -> char {
243243
if let Some(item_type) = item_type {
244244
match item_type {
245245
StatusItemType::Modified => 'M',

0 commit comments

Comments
 (0)