Skip to content

Commit 9001d9f

Browse files
committedMar 5, 2021
Add Lifetime span getter and setter
1 parent 38d99a7 commit 9001d9f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

Diff for: ‎src/lifetime.rs

+11
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ impl Lifetime {
5757
ident: Ident::new(&symbol[1..], span),
5858
}
5959
}
60+
61+
pub fn span(&self) -> Span {
62+
self.apostrophe
63+
.join(self.ident.span())
64+
.unwrap_or(self.apostrophe)
65+
}
66+
67+
pub fn set_span(&mut self, span: Span) {
68+
self.apostrophe = span;
69+
self.ident.set_span(span);
70+
}
6071
}
6172

6273
impl Display for Lifetime {

0 commit comments

Comments
 (0)