Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/keybindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ pub struct InputIterator<'a, Key: InputKey, S: Step<Key>> {
keys: std::vec::IntoIter<Key>,
}

impl<'a, K, S> Iterator for InputIterator<'a, K, S>
impl<K, S> Iterator for InputIterator<'_, K, S>
where
K: InputKey,
S: Step<K>,
Expand Down
4 changes: 2 additions & 2 deletions crates/modalkit-ratatui/src/cmdbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ where
}
}

impl<'a, I> StatefulWidget for CommandBar<'a, I>
impl<I> StatefulWidget for CommandBar<'_, I>
where
I: ApplicationInfo,
{
Expand All @@ -260,7 +260,7 @@ where
}
}

impl<'a, I> Default for CommandBar<'a, I>
impl<I> Default for CommandBar<'_, I>
where
I: ApplicationInfo,
{
Expand Down
10 changes: 6 additions & 4 deletions crates/modalkit-ratatui/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ where
}
}

impl<'a, T, I> StatefulWidget for List<'a, T, I>
impl<T, I> StatefulWidget for List<'_, T, I>
where
T: ListItem<I>,
I: ApplicationInfo,
Expand Down Expand Up @@ -1309,6 +1309,8 @@ where

#[cfg(test)]
mod tests {
use std::fmt::Display;

use super::*;
use ratatui::text::{Line, Span};

Expand All @@ -1331,9 +1333,9 @@ mod tests {
}
}

impl ToString for TestItem {
fn to_string(&self) -> String {
self.book.clone()
impl Display for TestItem {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.book)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/modalkit-ratatui/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ where
}
}

impl<'a, W, I> StatefulWidget for Screen<'a, W, I>
impl<W, I> StatefulWidget for Screen<'_, W, I>
where
W: Window<I>,
I: ApplicationInfo,
Expand Down
4 changes: 2 additions & 2 deletions crates/modalkit-ratatui/src/textbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ where
}
}

impl<'a, I> Default for TextBox<'a, I>
impl<I> Default for TextBox<'_, I>
where
I: ApplicationInfo,
{
Expand All @@ -1155,7 +1155,7 @@ where
}
}

impl<'a, I> StatefulWidget for TextBox<'a, I>
impl<I> StatefulWidget for TextBox<'_, I>
where
I: ApplicationInfo,
{
Expand Down
2 changes: 1 addition & 1 deletion crates/modalkit-ratatui/src/windows/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,7 @@ where
}
}

impl<'a, W, I> StatefulWidget for WindowLayout<'a, W, I>
impl<W, I> StatefulWidget for WindowLayout<'_, W, I>
where
W: Window<I>,
I: ApplicationInfo,
Expand Down
8 changes: 2 additions & 6 deletions crates/modalkit/src/editing/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,11 +1305,7 @@ where
(MoveDir1D::Next, Some(i)) => {
let idx = i.to_owned();

if idx >= count {
idx - count
} else {
0
}
idx.saturating_sub(count)
},
(MoveDir1D::Next, None) => {
return Ok(0);
Expand Down Expand Up @@ -1434,7 +1430,7 @@ where
mod tests {
pub use super::*;
pub use crate::editing::application::EmptyInfo;
pub use crate::editing::context::EditContextBuilder;

pub use crate::editing::store::{RegisterCell, RegisterPutFlags, Store};
pub use crate::env::vim::VimState;
pub use crate::prelude::TargetShape::{BlockWise, CharWise, LineWise};
Expand Down
4 changes: 2 additions & 2 deletions crates/modalkit/src/editing/cursor/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<'a> Iterator for CursorGroupIter<'a> {
}
}

impl<'a> DoubleEndedIterator for CursorGroupIter<'a> {
impl DoubleEndedIterator for CursorGroupIter<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
if let Some(m) = self.members.next_back() {
if let Some(ref mut l) = self.leader {
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<'a> Iterator for CursorGroupIterMut<'a> {
}
}

impl<'a> DoubleEndedIterator for CursorGroupIterMut<'a> {
impl DoubleEndedIterator for CursorGroupIterMut<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
if let Some(m) = self.members.next_back() {
if let Some(ref mut l) = self.leader {
Expand Down
8 changes: 4 additions & 4 deletions crates/modalkit/src/editing/rope/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl<'a> CharacterIterator<'a> {
}
}

impl<'a> Iterator for CharacterIterator<'a> {
impl Iterator for CharacterIterator<'_> {
type Item = char;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -386,7 +386,7 @@ impl<'a> Iterator for CharacterIterator<'a> {
}
}

impl<'a> DoubleEndedIterator for CharacterIterator<'a> {
impl DoubleEndedIterator for CharacterIterator<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
let res = self.rc_end.peek()?;

Expand All @@ -412,15 +412,15 @@ fn trimnl(slice: RopeSlice<'_>) -> RopeSlice<'_> {
}
}

impl<'a> Iterator for LineIterator<'a> {
impl Iterator for LineIterator<'_> {
type Item = EditRope;

fn next(&mut self) -> Option<Self::Item> {
Some(EditRope::from_slice(trimnl(self.iter.next()?)))
}
}

impl<'a> Iterator for NewlineIterator<'a> {
impl Iterator for NewlineIterator<'_> {
type Item = CharOff;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
Loading