Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix edition 2024, improve gm_quic::util #345

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

eareimu
Copy link
Contributor

@eareimu eareimu commented Jan 23, 2025

只接受Path不够好用,如果我要include_bytes!(),或者自己读取文件,或者比如从数据库读密钥l...还得手动去做解析

而泛型特化稳定遥遥无期,,所以将impl<P: AsRef> ToXXX for P 改为 impl ToXXX for &Path,对外界调用者来说就加一串.as_refas_path()的事

然后,就可以加上impl ToXXX for &[u8]

然后另一个改动就是运行了cargo fix --edition,2024版已经进了beta,快了

看了下改动,rust2024改了RTIP的自动捕获规则以和async fn保持一致。一些方法结尾都得加上use手动捕获,才可以保证未来可以编译通过

再就是2024会改临时变量的drop顺序(比如if let的),对我们的代码没有影响。自动修复把很多if let改成了match,其实没必要,有一部分改回来保持代码美观

再就是宏也更新,expr变成expr_2021,不该应该也不会有事,也就没跟随自动修复

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 63.15789% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gm-quic/src/util.rs 23.52% 13 Missing ⚠️
qrecovery/src/journal/sent.rs 50.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
qbase/src/util/bound_deque.rs 94.89% <100.00%> (+0.05%) ⬆️
qconnection/src/builder.rs 96.87% <100.00%> (ø)
qconnection/src/lib.rs 89.47% <100.00%> (+0.16%) ⬆️
qconnection/src/path/burst.rs 78.50% <100.00%> (ø)
qconnection/src/path/idle.rs 62.06% <100.00%> (+4.37%) ⬆️
qconnection/src/tls.rs 77.77% <ø> (ø)
qrecovery/src/journal/sent.rs 71.23% <50.00%> (-17.13%) ⬇️
gm-quic/src/util.rs 31.03% <23.52%> (-11.83%) ⬇️

... and 3 files with indirect coverage changes

@huster-zhangpeng huster-zhangpeng merged commit c6311a2 into main Jan 26, 2025
9 checks passed
@huster-zhangpeng huster-zhangpeng deleted the refactor/pem branch January 26, 2025 02:49
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.

3 participants