Skip to content

Conversation

neruneruna7
Copy link
Contributor

@neruneruna7 neruneruna7 commented May 6, 2024

内容

crates/test_util/build.rs内で使用されているsurfreqwestに置き換え

  • async_std::maintokio::mainに変更
  • test_util/Cargo.tomltokioreqwestのビルド時依存関係,必要なfeaturesを追加
  • 不要となった外部クレート,async-stdsurfを全体の依存関係から削除

reqwestクレートはデフォルトでリダイレクトを10件まで追跡するらしい.surf使用時にあったリダイレクトミドルウェアをクライアントに付加するコードに相当する部分はreqwestでは不要と判断.

関連 Issue

その他

async fn main() -> anyhow::Result<()> {
let mut dist = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
dist.push("data");

let dic_dir = dist.join(DIC_DIR_NAME);

Copy link
Member

Choose a reason for hiding this comment

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

ここと50行目の空行は削除できないでしょうか (44行目のは消してもそのままでも)。

Squash and mergeの方針の場合1PR=1コミットになるので、PRの主旨から外れる変更はできるだけ避けた方がよいというのが一般的な慣習かなと思っています。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

了解しました 空行は削除可能です

PRの趣旨から外れる、というのは全体の依存関係からsurf等を削除したことについてで合っているでしょうか?

Copy link
Member

Choose a reason for hiding this comment

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

そうですね。ここの空行の追加はsurf→reqwestの置き換えに関連しないと思います。

まあ避けた方がよいというのも程度と状況によりますし、diffを気にするあまりコードの状態が悪くなるのは本末転倒なのですが、このPRのような変更ならばコミットログを綺麗にする方に倒した方がよいかなと思った次第です。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • 不必要に追加された空行の削除
  • 依存関係の削除を,全体ではなくtest_utilクレート内のみに変更
    を行いました

依存関係の変更はあくまでtest_util内のみにとどめた方がよいかと思いましたが,issueがtokioランタイムに統一という趣旨なのでワークスペースの依存関係からsurfとasync-stdを削除するコミットを残したほうがよかったでしょうか...

Copy link
Member

Choose a reason for hiding this comment

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

すみません誤読していました 🙇

趣旨から外れるのは空行のところで、surfの排除自体は #777 に沿うと思います。git revert HEAD^^..していただければ!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

了解しました、ありがとうございます!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • ワークスペースの依存関係からsurfasync_stdを削除
    を行いました

Copy link
Member

@qryxip qryxip left a comment

Choose a reason for hiding this comment

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

お手数をおかけしましたが、LGTM! Cargo.lockが綺麗に900行近く小さくなりましたね。

approval×1でマージします。
CC: @Hiroshiba

@qryxip qryxip merged commit 6df6b75 into VOICEVOX:main May 8, 2024
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.

refactor: surfをreqwestに置き換える
2 participants