Skip to content

Add explicit lifetimes to borrowed return types #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
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
8 changes: 4 additions & 4 deletions src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl FamilyOwned {
}
}

pub fn as_family(&self) -> Family {
pub fn as_family(&self) -> Family<'_> {
match self {
Self::Name(name) => Family::Name(name),
Self::Serif => Family::Serif,
Expand Down Expand Up @@ -388,7 +388,7 @@ impl AttrsOwned {
}
}

pub fn as_attrs(&self) -> Attrs {
pub fn as_attrs(&self) -> Attrs<'_> {
Attrs {
color_opt: self.color_opt,
family: self.family_owned.as_family(),
Expand Down Expand Up @@ -422,7 +422,7 @@ impl AttrsList {
}

/// Get the default [Attrs]
pub fn defaults(&self) -> Attrs {
pub fn defaults(&self) -> Attrs<'_> {
self.defaults.as_attrs()
}

Expand Down Expand Up @@ -454,7 +454,7 @@ impl AttrsList {
/// Get the attribute span for an index
///
/// This returns a span that contains the index
pub fn get_span(&self, index: usize) -> Attrs {
pub fn get_span(&self, index: usize) -> Attrs<'_> {
self.spans
.get(&index)
.map(|v| v.as_attrs())
Expand Down
2 changes: 1 addition & 1 deletion src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ impl Buffer {
}

/// Get the visible layout runs for rendering and other tasks
pub const fn layout_runs(&self) -> LayoutRunIter {
pub fn layout_runs(&self) -> LayoutRunIter<'_> {
LayoutRunIter::new(self)
}

Expand Down
Loading