feat: support connection extra config#423
Draft
starrin wants to merge 1 commit intoMaaAssistantArknights:mainfrom
Draft
feat: support connection extra config#423starrin wants to merge 1 commit intoMaaAssistantArknights:mainfrom
starrin wants to merge 1 commit intoMaaAssistantArknights:mainfrom
Conversation
Author
|
喷了,还没在linux环境跑过构建 |
Member
|
可以把整个 extra 相关的东西全都放在 cfg(windows) 里面,毕竟短时间内其他平台大概率不会支持这个东西。 |
Author
目前其实就是这样干的,你的意思是希望把profile设置这部分也加上cfg(windows)吗? |
wangl-cc
reviewed
Sep 22, 2025
| use callback::summary; | ||
|
|
||
| mod external; | ||
| mod extra; |
Member
There was a problem hiding this comment.
可以直接在这里 cfg(windows),里面就不用每一个子模块都标注了。
| _ => None, | ||
| }; | ||
|
|
||
| match asst_config.connection.preset() { |
Member
There was a problem hiding this comment.
这整个 match 都可以用 cfg(windows) 来括起来。不过我个人更喜欢是把这个 match 当成 preset 的一个方法,接受 connection 作为参数,尽量不要这个函数在这里包含太多逻辑。
| adb_path: Some(String::from("/path/to/adb")), | ||
| address: Some(String::from("127.0.0.1:5555")), | ||
| config: Some(String::from("SomeConfig")), | ||
| emulator_path: None, |
Member
There was a problem hiding this comment.
其实可以改成
ConnectionConfig {
preset: Preset::Adb,
adb_path: Some(String::from("/path/to/adb")),
address: Some(String::from("127.0.0.1:5555")),
config: Some(String::from("SomeConfig")),
..Default::default()
}
这样更方便一点,而且之后如果要再加东西改起来也比较容易。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TODO: test and docs