Skip to content
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

Merged
merged 5 commits into from
Feb 1, 2024

Conversation

biplab5464
Copy link
Contributor

No description provided.

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/rm/rm1 (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker linked an issue Feb 1, 2024 that may be closed by this pull request
i: &mut usize,
bound: usize,
format_str: &str,
use_printf: bool,
Copy link
Contributor

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.

Copy link
Contributor Author

@biplab5464 biplab5464 Feb 1, 2024

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

@@ -529,7 +543,6 @@ impl Stater {
}
Ok(tokens)
}

Copy link
Contributor

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.

Copy link
Contributor Author

@biplab5464 biplab5464 Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was by mistake,

@cakebaker cakebaker merged commit 4a7dfa7 into uutils:main Feb 1, 2024
60 of 62 checks passed
@cakebaker
Copy link
Contributor

Good work, thanks!

@biplab5464 biplab5464 deleted the test branch February 1, 2024 17:09
@biplab5464
Copy link
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stat.rs: Refactor to remove #[allow(clippy::cognitive_complexity)]
2 participants