stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] #5881 #5924
Merged
cakebaker merged 5 commits intouutils:mainfrom Feb 1, 2024
Merged
stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] #5881 #5924cakebaker merged 5 commits intouutils:mainfrom
cakebaker merged 5 commits intouutils:mainfrom
Conversation
added 3 commits
January 28, 2024 20:22
…cognitive_complexity)] uutils#5881
|
GNU testsuite comparison: |
cakebaker
reviewed
Feb 1, 2024
src/uu/stat/src/stat.rs
Outdated
| i: &mut usize, | ||
| bound: usize, | ||
| format_str: &str, | ||
| use_printf: bool, |
Contributor
There was a problem hiding this comment.
You can simplify this function by removing use_printf and handling the false case in generate_tokens.
Contributor
Author
There was a problem hiding this comment.
ok, i am moving the use_printf if else logic to the generate_tokens function
thanks for the suggestion it will save same some space and time by not copying the value to a function
cakebaker
reviewed
Feb 1, 2024
| } | ||
| Ok(tokens) | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
I don't understand why you remove this empty line, it separates the two functions.
Contributor
Author
There was a problem hiding this comment.
it was by mistake,
added 2 commits
February 1, 2024 19:38
…itive_complexity)] uutils#5881
…itive_complexity)] uutils#5881
Contributor
|
Good work, thanks! |
Contributor
Author
|
Thanks for you cooperation |
ysthakur
pushed a commit
to ysthakur/coreutils
that referenced
this pull request
Feb 27, 2024
…utils#5881 (uutils#5924) * stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] uutils#5881 * remvoe Vec when ruturing stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] uutils#5881 * formmating issue stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] uutils#5881 * cakebaker suggestion stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] uutils#5881 * sytle and lint issue stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] uutils#5881 --------- Co-authored-by: biplab5464 <biplab5464@outlook.com>
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.
No description provided.