Add explicit lifetimes to borrowed return types (#411)

This commit is contained in:
romanstingler 2025-08-11 22:17:00 +02:00 committed by GitHub
parent a2f1f4b2a0
commit f7033bb043
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -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,
@ -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(),
@ -422,7 +422,7 @@ impl AttrsList {
}
/// Get the default [Attrs]
pub fn defaults(&self) -> Attrs {
pub fn defaults(&self) -> Attrs<'_> {
self.defaults.as_attrs()
}
@ -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())

View file

@ -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)
}