Skip to content

Change/surf to reqwest - #788

Merged
qryxip merged 10 commits into
VOICEVOX:mainfrom
neruneruna7:change/surf-to-reqwest
May 8, 2024
Merged

qryxip merged 10 commits into
VOICEVOX:mainfrom
neruneruna7:change/surf-to-reqwest

Conversation

@neruneruna7

@neruneruna7 neruneruna7 commented May 6, 2024 •

Copy link
Copy Markdown
Contributor

内容

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

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

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

関連 Issue

その他

Comment thread crates/test_util/build.rs Outdated
dist.push("data");

let dic_dir = dist.join(DIC_DIR_NAME);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@qryxip qryxip left a comment

Copy link
Copy Markdown
Member

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