apache / apache/datafusion-sqlparser-rs

Rename VisitorMut::visit to VisitorMut::visit_mut

未关闭
#2,067 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
17

描述

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:

``` Rust
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`
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

在仓库中搜索 VisitorMut trait 及其 visit 方法,然后跟踪这些匹配项所显示的实现和调用点。统一重命名该方法,并验证 Visitor 和 VisitorMut 能否在同一上下文中使用而不会出现所报告的 trait-bound 错误;运行相关的现有 Rust 测试或检查。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
backend-api-design
Issue 类型
重构
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
58/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。