Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
QuarticCat committed Sep 30, 2022
1 parent 7d36c5f commit 80fd488
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/diff/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct SyntaxRefOrId<'a> {
phantom: PhantomData<&'a Syntax<'a>>,
}

impl SyntaxRefOrId<'_> {
impl<'a> SyntaxRefOrId<'a> {
pub fn is_ref(&self) -> bool {
self.data & 1 == 0
}
Expand All @@ -44,7 +44,7 @@ impl SyntaxRefOrId<'_> {
self.data & 1 == 1
}

pub fn get_ref<'a>(&self) -> Option<&'a Syntax<'a>> {
pub fn get_ref(&self) -> Option<&'a Syntax<'a>> {
if self.is_ref() {
Some(unsafe { transmute_copy(&self.data) })
} else {
Expand All @@ -56,7 +56,7 @@ impl SyntaxRefOrId<'_> {
impl<'a> From<&'a Syntax<'a>> for SyntaxRefOrId<'a> {
fn from(s: &'a Syntax<'a>) -> Self {
Self {
data: unsafe { transmute_copy(&s) },
data: s as *const _ as _,
phantom: PhantomData,
}
}
Expand Down

0 comments on commit 80fd488

Please sign in to comment.