-
-
Notifications
You must be signed in to change notification settings - Fork 257
re-fix rust #292
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
Open
Mikachu2333
wants to merge
26
commits into
RubyMetric:dev
Choose a base branch
from
Mikachu2333:fix/rust_on_win
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
re-fix rust #292
Conversation
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
This reverts commit fabf884.
可恶,怎么win和linux还不通用啊 |
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.
问题描述
方案与实现
xy.h
xy_str_find
用于查找str子串并返回 (bool, pos_begin, pos_end)xy_str_take_until_newline
与上面的函数结合使用,用于获取从传入字符串的[0]
开始直到下一个换行符的所有字符,主要在提取配置时使用xy_file_to_str
用于读取文件并返回全部内容(以字符串形式返回),已处理所有换行符为\n
core.c
chsrc_log_overwrite
对覆写特别设置chsrc_log_backup
chsrc_prepend_to_file
impl for wincargo.c
note_get_src_default
把部分重复的通知逻辑抽出来了note_get_src_mirror
略pl_rust_cargo_getsrc
sed
/grep
的代码write_rust_config
把重复的逻辑抽出来了pl_rust_cargo_getsrc
用了很笨的办法,读取文件 -> 查找字段 -> 手动获取有效信息 -> 手动格式化,好消息是对所有系统都适用,因为mirror必须按官方规范来否则rust不识别,所以“获取有效信息”和“格式化”这两步也没啥额外问题,感觉现在错误处理有些太繁琐了,似乎可以精简rustup.c
格式化rawstr4c.h
删除无用数据fw.c
其它
chsrc_prepend_to_file
并且暂未发现问题。因为引用关系错综复杂,我认为有且仅有chsrc_prepend_to_file
可以被单独提取成一个pr但不是很值得……