Skip to content

Commit 876d8f7

Browse files
Added documentation to visitor methods
1 parent 14e1182 commit 876d8f7

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/ast/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6457,7 +6457,7 @@ pub enum MinMaxValue {
64576457
Empty,
64586458
/// NO MINVALUE / NO MAXVALUE.
64596459
None,
6460-
/// MINVALUE `<expr>` / MAXVALUE `<expr>`.
6460+
/// `MINVALUE <expr>` / `MAXVALUE <expr>`.
64616461
Some(Expr),
64626462
}
64636463

@@ -9154,7 +9154,7 @@ pub enum CopyLegacyOption {
91549154
Delimiter(char),
91559155
/// EMPTYASNULL
91569156
EmptyAsNull,
9157-
/// ENCRYPTED \[ AUTO \]
9157+
/// `ENCRYPTED \[ AUTO \]`
91589158
Encrypted {
91599159
/// Whether `AUTO` was specified for encryption.
91609160
auto: bool,

src/ast/value.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ pub enum Value {
124124
#[cfg(not(feature = "bigdecimal"))]
125125
Number(String, bool),
126126
#[cfg(feature = "bigdecimal")]
127-
// HINT: use `test_utils::number` to make an instance of
128-
// Value::Number This might help if you your tests pass locally
129-
// but fail on CI with the `--all-features` flag enabled
127+
/// HINT: use `test_utils::number` to make an instance of
128+
/// Value::Number This might help if you your tests pass locally
129+
/// but fail on CI with the `--all-features` flag enabled
130+
/// Numeric literal (uses `BigDecimal` when the `bigdecimal` feature is enabled).
130131
Number(BigDecimal, bool),
131132
/// 'string value'
132133
SingleQuotedString(String),

src/ast/visitor.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ use core::ops::ControlFlow;
3232
/// #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
3333
/// ```
3434
pub trait Visit {
35+
/// Visit this node with the provided [`Visitor`].
36+
///
37+
/// Implementations should call the appropriate visitor hooks to traverse
38+
/// child nodes and return a `ControlFlow` value to allow early exit.
3539
fn visit<V: Visitor>(&self, visitor: &mut V) -> ControlFlow<V::Break>;
3640
}
3741

@@ -47,6 +51,11 @@ pub trait Visit {
4751
/// #[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
4852
/// ```
4953
pub trait VisitMut {
54+
/// Mutably visit this node with the provided [`VisitorMut`].
55+
///
56+
/// Implementations should call the appropriate mutable visitor hooks to
57+
/// traverse and allow in-place mutation of child nodes. Returning a
58+
/// `ControlFlow` value permits early termination of the traversal.
5059
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>;
5160
}
5261

0 commit comments

Comments
 (0)