mirror of
https://github.com/RGBCube/cstree
synced 2025-07-27 09:07:44 +00:00
fix Clone
impls for resolved elements
This commit is contained in:
parent
b3390aeea6
commit
87699336bb
1 changed files with 16 additions and 1 deletions
|
@ -22,7 +22,6 @@ use crate::{
|
|||
/// # See also
|
||||
/// [`SyntaxNode`]
|
||||
/// [`SyntaxNode::new_root_with_resolver`]
|
||||
#[derive(Clone)]
|
||||
#[repr(transparent)]
|
||||
pub struct ResolvedNode<L: Language, D: 'static = ()> {
|
||||
pub(super) syntax: SyntaxNode<L, D>,
|
||||
|
@ -41,6 +40,14 @@ impl<L: Language, D> ResolvedNode<L, D> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<L: Language, D> Clone for ResolvedNode<L, D> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
syntax: self.syntax.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<L: Language, D> Deref for ResolvedNode<L, D> {
|
||||
type Target = SyntaxNode<L, D>;
|
||||
|
||||
|
@ -77,6 +84,14 @@ impl<L: Language, D> ResolvedToken<L, D> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<L: Language, D> Clone for ResolvedToken<L, D> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
syntax: self.syntax.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<L: Language, D> Deref for ResolvedToken<L, D> {
|
||||
type Target = SyntaxToken<L, D>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue