Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Araxeus committed Jun 1, 2024
1 parent 12e5327 commit 4e60d05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::multiple_crate_versions)]
mod structs;
mod utils;

Expand Down Expand Up @@ -52,7 +53,7 @@ fn main_loop(initial_path: String) {
if entry.filetype.should_exec() || modifier == KeyModifiers::CONTROL {
match open::that(&entry.path) {
// quit if file was opened
Ok(_) => break,
Ok(()) => break,
// else display error and open as directory
Err(_) => err(format!(
"Failed to open file \"{}\"",
Expand Down
5 changes: 3 additions & 2 deletions src/structs/prompt_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::utils::{get_computer_name, link, link_with_label, pretty_path};
use super::Entry;

/// A colorful theme
#[allow(dead_code)]
pub struct Theme {
/// The style for default values
pub defaults_style: Style,
Expand Down Expand Up @@ -199,7 +200,7 @@ impl Theme {
if cursor_pos < search_term.len() {
let split = search_term.split_at(cursor_pos);
let head = split.0.concat();
let cursor = self.fuzzy_cursor_style.apply_to(split.1.get(0).unwrap());
let cursor = self.fuzzy_cursor_style.apply_to(split.1.first().unwrap());
let tail = split.1[1..].concat();

write!(f, "{} {head}{cursor}{tail}", &self.prompt_suffix)
Expand All @@ -226,7 +227,7 @@ pub struct TermRenderer<'a> {
}

impl<'a> TermRenderer<'a> {
pub const fn new(term: &'a Term, theme: &'a Theme) -> TermRenderer<'a> {
pub const fn new(term: &'a Term, theme: &'a Theme) -> Self {
TermRenderer {
term,
theme,
Expand Down

0 comments on commit 4e60d05

Please sign in to comment.