Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
panekj committed Nov 30, 2024
1 parent 8e8337b commit e96c39f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion editor-core/src/buffer/rope_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl<'a> RopeTextRef<'a> {
Self { text }
}
}
impl<'a> RopeText for RopeTextRef<'a> {
impl RopeText for RopeTextRef<'_> {
fn text(&self) -> &Rope {
self.text
}
Expand Down
4 changes: 2 additions & 2 deletions editor-core/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct RegionsIter<'c> {
idx: usize,
}

impl<'c> Iterator for RegionsIter<'c> {
impl Iterator for RegionsIter<'_> {
type Item = (usize, usize);

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<'c> Iterator for RegionsIter<'c> {
}
}

impl<'c> ExactSizeIterator for RegionsIter<'c> {}
impl ExactSizeIterator for RegionsIter<'_> {}

impl CursorMode {
pub fn offset(&self) -> usize {
Expand Down
4 changes: 2 additions & 2 deletions renderer/src/text/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub struct Attrs<'a> {
line_height: LineHeightValue,
}

impl<'a> Default for Attrs<'a> {
impl Default for Attrs<'_> {
fn default() -> Self {
Self::new()
}
Expand Down Expand Up @@ -237,7 +237,7 @@ struct ParseList<'a> {
pos: usize,
}

impl<'a> Iterator for ParseList<'a> {
impl Iterator for ParseList<'_> {
type Item = FamilyOwned;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion renderer/src/text/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct LayoutRun<'a> {
pub line_w: f32,
}

impl<'a> LayoutRun<'a> {
impl LayoutRun<'_> {
/// Return the pixel span `Some((x_left, x_width))` of the highlighted area between `cursor_start`
/// and `cursor_end` within this run, or None if the cursor range does not intersect this run.
/// This may return widths of zero if `cursor_start == cursor_end`, if the run is empty, or if the
Expand Down
6 changes: 3 additions & 3 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct EventCx<'a> {
pub(crate) app_state: &'a mut AppState,
}

impl<'a> EventCx<'a> {
impl EventCx<'_> {
pub fn app_state_mut(&mut self) -> &mut AppState {
self.app_state
}
Expand Down Expand Up @@ -940,7 +940,7 @@ pub struct PaintCx<'a> {
pub(crate) saved_z_indexes: Vec<Option<i32>>,
}

impl<'a> PaintCx<'a> {
impl PaintCx<'_> {
pub fn save(&mut self) {
self.saved_transforms.push(self.transform);
self.saved_clips.push(self.clip);
Expand Down Expand Up @@ -1269,7 +1269,7 @@ pub struct UpdateCx<'a> {
pub(crate) app_state: &'a mut AppState,
}

impl<'a> UpdateCx<'a> {
impl UpdateCx<'_> {
pub fn app_state_mut(&mut self) -> &mut AppState {
self.app_state
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/editor/visual_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ mod tests {
}
}
}
impl<'a> TextLayoutProvider for TestTextLayoutProvider<'a> {
impl TextLayoutProvider for TestTextLayoutProvider<'_> {
fn text(&self) -> Rope {
self.text.clone()
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/rich_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl IntoView for RichSpanOwned {
rich_text(move || layout.clone())
}
}
impl<'a> IntoView for RichSpan<'a> {
impl IntoView for RichSpan<'_> {
type V = RichText;

fn into_view(self) -> Self::V {
Expand Down Expand Up @@ -280,7 +280,7 @@ impl<'a> std::ops::Add<&'a str> for RichSpan<'a> {
}
}
}
impl<'a> std::ops::Add<String> for RichSpan<'a> {
impl std::ops::Add<String> for RichSpan<'_> {
type Output = RichSpanOwned;

fn add(self, rhs: String) -> Self::Output {
Expand Down

0 comments on commit e96c39f

Please sign in to comment.