Skip to content

Commit

Permalink
cleanup(record): remove unnecessary lifetimes from Component::draw
Browse files Browse the repository at this point in the history
  • Loading branch information
arxanas committed Feb 28, 2023
1 parent c6f68d8 commit c3a6bf6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions scm-record/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ pub(crate) trait Component: Sized {
/// was drawn.
type Id: Clone + Debug + Eq + Hash;

/// Get the ID for this compoent.
/// Get the ID for this component.
fn id(&self) -> Self::Id;

/// Draw this component and any child components.
fn draw<'a, 'b: 'a>(&'b self, viewport: &'a mut Viewport<Self::Id>, x: isize, y: isize);
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize);
}
10 changes: 5 additions & 5 deletions scm-record/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ impl<Id: Clone + Debug + Eq + Hash> Component for TristateBox<Id> {
self.id.clone()
}

fn draw<'a, 'b: 'a>(&'b self, viewport: &'a mut Viewport<Self::Id>, x: isize, y: isize) {
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize) {
let span = Span::styled(self.text(), Style::default().add_modifier(Modifier::BOLD));
viewport.draw_span(x, y, &span);
}
Expand Down Expand Up @@ -971,7 +971,7 @@ impl Component for App<'_> {
ComponentId::App
}

fn draw<'a, 'b: 'a>(&'b self, viewport: &'a mut Viewport<Self::Id>, x: isize, y: isize) {
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize) {
let Self {
debug_info,
file_views,
Expand Down Expand Up @@ -1023,7 +1023,7 @@ impl Component for FileView<'_> {
ComponentId::SelectableItem(SelectionKey::File(self.file_key))
}

fn draw<'a, 'b: 'a>(&'b self, viewport: &'a mut Viewport<Self::Id>, x: isize, y: isize) {
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize) {
let Self {
debug,
file_key: _,
Expand Down Expand Up @@ -1099,7 +1099,7 @@ impl Component for SectionView<'_> {
ComponentId::SelectableItem(SelectionKey::Section(self.section_key))
}

fn draw<'a, 'b: 'a>(&'b self, viewport: &'a mut Viewport<Self::Id>, x: isize, y: isize) {
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize) {
let Self {
use_unicode,
section_key,
Expand Down Expand Up @@ -1232,7 +1232,7 @@ impl Component for SectionLineView<'_> {
ComponentId::SelectableItem(SelectionKey::Line(self.line_key))
}

fn draw<'a, 'b: 'a>(&'b self, viewport: &'a mut Viewport<Self::Id>, x: isize, y: isize) {
fn draw(&self, viewport: &mut Viewport<Self::Id>, x: isize, y: isize) {
let Self { line_key: _, inner } = self;
match inner {
SectionLineViewInner::Unchanged { line } => {
Expand Down

0 comments on commit c3a6bf6

Please sign in to comment.