Skip to content

Rename VisitorMut::visit to VisitorMut::visit_mut #2067

@niebayes

Description

@niebayes

There're cases we need to use Visitor::visit and VisitorMut::visit in the same context. Since they're of the same name, compiler would be confused.

For example:

        impl Visitor For NoopVisitor { .. }
        impl VisitorMut for NoopVisitorMut { .. }

        let mut visitor = NoopVisitor {};
        let _ = stmt.visit(&mut visitor);

        let mut visitor_mut = NoopVisitorMut {};
        let _ = stmt.visit(&mut visitor_mut);

Would raise the error:

the trait bound `NoopVisitorMut: sqlparser::ast::Visitor` is not satisfied
the trait `sqlparser::ast::Visitor` is implemented for `NoopVisitor`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions