Skip to content

Commit

Permalink
Update cargo and rust
Browse files Browse the repository at this point in the history
  • Loading branch information
cantino committed Dec 16, 2022
1 parent 574e5a8 commit a88cabb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 32 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

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

7 changes: 2 additions & 5 deletions src/command_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ impl CommandInput {
}
}

if tmp < 0 {
tmp = 0;
} else if tmp > self.len as isize {
tmp = self.len as isize;
}
tmp = tmp.clamp(0, self.len as isize);
self.cursor = tmp as usize;
}

Expand Down Expand Up @@ -254,6 +250,7 @@ impl CommandInput {
word_index += 1;
}

#[allow(clippy::implicit_saturating_sub)]
if word_index > 0 {
word_index -= 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/history_cleaner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn clean_temporary_files(mcfly_history: &Path, history_format: HistoryFormat, co
err
)
});
let paths = fs::read_dir(&expanded_path).unwrap();
let paths = fs::read_dir(expanded_path).unwrap();

for entry in paths.flatten() {
if let Some(file_name) = entry.path().file_name() {
Expand Down
7 changes: 2 additions & 5 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,7 @@ impl<'a> Interface<'a> {
write!(
screen,
"{}{}",
cursor::Goto(
1,
(command_line_index as i16 + result_top_index as i16) as u16
),
cursor::Goto(1, (command_line_index + result_top_index as i16) as u16),
Interface::truncate_for_display(
command,
&self.input.command,
Expand All @@ -275,7 +272,7 @@ impl<'a> Interface<'a> {
"{}",
cursor::Goto(
width - 9,
(command_line_index as i16 + result_top_index as i16) as u16
(command_line_index + result_top_index as i16) as u16
)
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/shell_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub fn history_file_path() -> PathBuf {
)
}),
);
fs::canonicalize(&path).unwrap_or_else(|err| {
fs::canonicalize(path).unwrap_or_else(|err| {
panic!(
"McFly error: The contents of $HISTFILE/$MCFLY_HISTFILE appears invalid ({})",
err
Expand Down

0 comments on commit a88cabb

Please sign in to comment.