apache / apache/datafusion-sqlparser-rs

Rename VisitorMut::visit to VisitorMut::visit_mut

未關閉
#2,067 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
3.5k
分支
774
平均合併
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 摘要。