-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)] #5881 #5924
Conversation
…cognitive_complexity)] uutils#5881
GNU testsuite comparison:
|
src/uu/stat/src/stat.rs
Outdated
i: &mut usize, | ||
bound: usize, | ||
format_str: &str, | ||
use_printf: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify this function by removing use_printf
and handling the false
case in generate_tokens
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
src/uu/stat/src/stat.rs
Outdated
@@ -529,7 +543,6 @@ impl Stater { | |||
} | |||
Ok(tokens) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you remove this empty line, it separates the two functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was by mistake,
…itive_complexity)] uutils#5881
…itive_complexity)] uutils#5881
Good work, thanks! |
Thanks for you cooperation |
…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>
No description provided.