Skip to content

Commit c6595dd

Browse files
committed
Add explicit lifetimes to borrowed return types
1 parent a2f1f4b commit c6595dd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/attrs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl FamilyOwned {
8888
}
8989
}
9090

91-
pub fn as_family(&self) -> Family {
91+
pub fn as_family(&self) -> Family<'_> {
9292
match self {
9393
Self::Name(name) => Family::Name(name),
9494
Self::Serif => Family::Serif,
@@ -388,7 +388,7 @@ impl AttrsOwned {
388388
}
389389
}
390390

391-
pub fn as_attrs(&self) -> Attrs {
391+
pub fn as_attrs(&self) -> Attrs<'_> {
392392
Attrs {
393393
color_opt: self.color_opt,
394394
family: self.family_owned.as_family(),
@@ -422,7 +422,7 @@ impl AttrsList {
422422
}
423423

424424
/// Get the default [Attrs]
425-
pub fn defaults(&self) -> Attrs {
425+
pub fn defaults(&self) -> Attrs<'_> {
426426
self.defaults.as_attrs()
427427
}
428428

@@ -454,7 +454,7 @@ impl AttrsList {
454454
/// Get the attribute span for an index
455455
///
456456
/// This returns a span that contains the index
457-
pub fn get_span(&self, index: usize) -> Attrs {
457+
pub fn get_span(&self, index: usize) -> Attrs<'_> {
458458
self.spans
459459
.get(&index)
460460
.map(|v| v.as_attrs())

src/buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ impl Buffer {
864864
}
865865

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

0 commit comments

Comments
 (0)