Skip to content

Commit 5ba9241

Browse files
committed
fix clippy errors
1 parent 82049cf commit 5ba9241

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/structs/prompt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ impl Prompt<'_> {
5252
/// Result contains `Some(index)` if user hit 'Enter' or `None` if user cancelled with 'Esc' or 'q'.
5353
#[inline]
5454
pub fn run(&self) -> io::Result<Option<(usize, KeyModifiers)>> {
55-
self._run(&Term::stderr(), true)
55+
self.run_internal(&Term::stderr(), true)
5656
}
5757

5858
/// Like `interact` but allows a specific terminal to be set.
5959
/// Ignore `clippy::too-many-lines`
6060
#[allow(clippy::too_many_lines)] // TODO: refactor
61-
fn _run(&self, term: &Term, allow_quit: bool) -> io::Result<Option<(usize, KeyModifiers)>> {
61+
fn run_internal(&self, term: &Term, allow_quit: bool) -> io::Result<Option<(usize, KeyModifiers)>> {
6262
// This cursor iterates over the graphemes vec rather than the search term
6363
let mut cursor_pos = 0;
6464
let mut search_term: Vec<String> = Vec::new();

src/structs/prompt_renderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl Theme {
164164
char = format!("{}", self.active_item_style.apply_to(c));
165165
} else {
166166
char = format!("{c}");
167-
};
167+
}
168168
output.push_str(&char);
169169
}
170170
write!(f, "{}", link_with_label(pretty_path(&entry.path), &output))?;
@@ -246,7 +246,7 @@ impl<'a> TermRenderer<'a> {
246246
f: F,
247247
) -> io::Result<()> {
248248
let mut buf = String::new();
249-
f(self, &mut buf).map_err(|err| io::Error::new(io::ErrorKind::Other, err))?;
249+
f(self, &mut buf).map_err(io::Error::other)?;
250250
self.height += buf.chars().filter(|&x| x == '\n').count() + 1;
251251
self.term.write_line(&buf)
252252
}

src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn resolve_lnk(path: &String) -> String {
2121

2222
if link.is_err() {
2323
err(format!("Failed to read shortcut \"{}\"", pretty_path(path)));
24-
return path.to_string();
24+
return path.clone();
2525
}
2626

2727
let path_to_open = link
@@ -31,7 +31,7 @@ pub fn resolve_lnk(path: &String) -> String {
3131
.and_then(|link_target| fs::canonicalize(link_target).ok());
3232

3333
path_to_open.map_or_else(
34-
|| path.to_string(),
34+
|| path.clone(),
3535
|path_to_open| path_to_open.to_string_lossy().to_string(),
3636
)
3737
}

0 commit comments

Comments
 (0)