This repository was archived by the owner on Jul 24, 2024. It is now read-only.
File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ use std:: slice:: Iter ;
2
+
1
3
use schemars:: JsonSchema ;
2
4
use serde:: Deserialize ;
3
5
use serde:: Serialize ;
@@ -33,6 +35,21 @@ pub struct ConstantStatement {
33
35
pub semicolon : Span , // `;`
34
36
}
35
37
38
+ impl ConstantStatement {
39
+ pub fn iter ( & self ) -> Iter < ' _ , ConstantEntry > {
40
+ self . entries . iter ( )
41
+ }
42
+ }
43
+
44
+ impl IntoIterator for ConstantStatement {
45
+ type Item = ConstantEntry ;
46
+ type IntoIter = std:: vec:: IntoIter < Self :: Item > ;
47
+
48
+ fn into_iter ( self ) -> Self :: IntoIter {
49
+ self . entries . into_iter ( )
50
+ }
51
+ }
52
+
36
53
impl Node for ConstantStatement {
37
54
fn children ( & mut self ) -> Vec < & mut dyn Node > {
38
55
self . entries
@@ -54,6 +71,21 @@ pub struct ClassishConstant {
54
71
pub semicolon : Span , // `;`
55
72
}
56
73
74
+ impl ClassishConstant {
75
+ pub fn iter ( & self ) -> Iter < ' _ , ConstantEntry > {
76
+ self . entries . iter ( )
77
+ }
78
+ }
79
+
80
+ impl IntoIterator for ClassishConstant {
81
+ type Item = ConstantEntry ;
82
+ type IntoIter = std:: vec:: IntoIter < Self :: Item > ;
83
+
84
+ fn into_iter ( self ) -> Self :: IntoIter {
85
+ self . entries . into_iter ( )
86
+ }
87
+ }
88
+
57
89
impl Node for ClassishConstant {
58
90
fn children ( & mut self ) -> Vec < & mut dyn Node > {
59
91
self . entries
You can’t perform that action at this time.
0 commit comments