Skip to content

Commit

Permalink
Fix some clippy warnings
Browse files Browse the repository at this point in the history
with `cargo test --all --all-targets --all-features`
  • Loading branch information
gwenn committed Dec 2, 2023
1 parent fafa0b9 commit 11cf445
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions examples/custom_key_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ impl ConditionalEventHandler for TabEventHandler {
debug_assert_eq!(*evt, Event::from(KeyEvent::from('\t')));
if ctx.line()[..ctx.pos()]
.chars()
.rev()
.next()
.next_back()
.filter(|c| c.is_whitespace())
.is_some()
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ fn complete_line<H: Helper>(

let selected_items = Skim::run_with(&options, Some(rx_item))
.map(|out| out.selected_items)
.unwrap_or_else(Vec::new);
.unwrap_or_default();

// match the first (and only) returned option with the candidate and update the
// line otherwise only refresh line to clear the skim UI changes
Expand Down
4 changes: 2 additions & 2 deletions src/tty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,14 @@ pub trait Term {
// and re-export into mod.rs scope
#[cfg(all(windows, not(target_arch = "wasm32")))]
mod windows;
#[cfg(all(windows, not(target_arch = "wasm32")))]
#[cfg(all(windows, not(target_arch = "wasm32"), not(test)))]
pub use self::windows::*;

// If on Unix platform import Unix TTY module
// and re-export into mod.rs scope
#[cfg(all(unix, not(target_arch = "wasm32")))]
mod unix;
#[cfg(all(unix, not(target_arch = "wasm32")))]
#[cfg(all(unix, not(target_arch = "wasm32"), not(test)))]
pub use self::unix::*;

#[cfg(any(test, target_arch = "wasm32"))]
Expand Down

0 comments on commit 11cf445

Please sign in to comment.