refactor: fix edition 2024, improve gm_quic::util #345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
只接受Path不够好用,如果我要include_bytes!(),或者自己读取文件,或者比如从数据库读密钥l...还得手动去做解析
而泛型特化稳定遥遥无期,,所以将impl<P: AsRef> ToXXX for P 改为 impl ToXXX for &Path,对外界调用者来说就加一串
.as_ref
和as_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,不该应该也不会有事,也就没跟随自动修复