fix: use Pattern_White_Space for whitespace handling#22008
fix: use Pattern_White_Space for whitespace handling#22008vikashsiwach wants to merge 4 commits intorust-lang:masterfrom
Conversation
cc38f6a to
0fa9bdb
Compare
There was a problem hiding this comment.
Looks good, thanks for these fixes!
Usually we try to avoid moving or renaming functions. This makes it easier for reviewers to see what's actually changed.
Please edit the original functions to fix any bugs, and test them in their original locations.
If you think moves or renames are needed to make the code clearer, please put them in separate commits.
0fa9bdb to
04ab2f6
Compare
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod term_search_syntax_compare_tests { |
There was a problem hiding this comment.
I don't think unit tests are necessary here.
There was a problem hiding this comment.
I used unit tests here to show the incorrect space handling. Now the issue has been fixed ,hence i removed the unit tests in the latest commit.
| // } | ||
|
|
||
|
|
||
| fn trim(s: &str) -> String { |
There was a problem hiding this comment.
Maybe call this drop_whitespace or similar, trim feels like a bad name.
There was a problem hiding this comment.
Changed the fn trim to fn drop_whitespace as suggested.
504d602 to
242fe0c
Compare
|
Hi @lnicola , I made some changes in code as suggested by you. Kindly take a look on it and give your feedback. |
Description
This PR fixes incorrect whitespace handling in
analysis_stats.rsby implementing Rust's definition of whitespace (Pattern_white_space).Issue
Some parts fo code were using
char::is_whitespacewhich was missing character like vertical tab ( \u{000B}).Fixed
parser::is_rust_whitespacewhich follows Rust'sPattern_White_Space.Related Issue
This PR addresses the Outreachy issue : non-macro code miscompare