Skip to content

Commit 80fd488

Browse files
committed
Minor fixes
1 parent 7d36c5f commit 80fd488

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diff/graph.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct SyntaxRefOrId<'a> {
3535
phantom: PhantomData<&'a Syntax<'a>>,
3636
}
3737

38-
impl SyntaxRefOrId<'_> {
38+
impl<'a> SyntaxRefOrId<'a> {
3939
pub fn is_ref(&self) -> bool {
4040
self.data & 1 == 0
4141
}
@@ -44,7 +44,7 @@ impl SyntaxRefOrId<'_> {
4444
self.data & 1 == 1
4545
}
4646

47-
pub fn get_ref<'a>(&self) -> Option<&'a Syntax<'a>> {
47+
pub fn get_ref(&self) -> Option<&'a Syntax<'a>> {
4848
if self.is_ref() {
4949
Some(unsafe { transmute_copy(&self.data) })
5050
} else {
@@ -56,7 +56,7 @@ impl SyntaxRefOrId<'_> {
5656
impl<'a> From<&'a Syntax<'a>> for SyntaxRefOrId<'a> {
5757
fn from(s: &'a Syntax<'a>) -> Self {
5858
Self {
59-
data: unsafe { transmute_copy(&s) },
59+
data: s as *const _ as _,
6060
phantom: PhantomData,
6161
}
6262
}

0 commit comments

Comments
 (0)