Skip to content

Commit 28abe63

Browse files
committed
chore: Implement AsRef for TypedName<T>
1 parent 8e35a5a commit 28abe63

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

rusty_parser/src/specific/core/var_name.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ impl<T: VarType> TypedName<T> {
2626
}
2727
}
2828

29+
impl<T: VarType> AsRef<BareName> for TypedName<T> {
30+
fn as_ref(&self) -> &BareName {
31+
&self.bare_name
32+
}
33+
}
34+
35+
impl<T: VarType> AsRef<T> for TypedName<T> {
36+
fn as_ref(&self) -> &T {
37+
&self.var_type
38+
}
39+
}
40+
2941
pub trait VarType: HasExpressionType {
3042
fn new_built_in_compact(q: TypeQualifier) -> Self;
3143

0 commit comments

Comments
 (0)