Skip to content

Conversation

@tisonkun
Copy link
Contributor

This closes #2

@tisonkun tisonkun requested a review from andylokandy October 24, 2025 14:20
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
/// A visitor that can be used to traverse a data structure.
pub trait Visitor {
/// The type that can be used to break traversal early.
type Break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Break;
type Break = ();

maybe give it a default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +25 to +29
pub struct FnVisitor<T, B, F1, F2> {
enter: F1,
leave: F2,
m: PhantomData<T>,
marker_type: PhantomData<T>,
marker_break: PhantomData<B>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PhantomData can be eliminated once we move the F1 F2 bound onto struct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can make a follow-up? I suppose then we need both FnVisitor and FnMutVisitor?

@tisonkun tisonkun merged commit db8aec9 into main Oct 26, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to early stop

3 participants