-
-
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
Reduce cognitive complexity: just move some of the contents in functions #4743
Conversation
/// # Panics | ||
/// | ||
/// Panics if multiple hash algorithms are specified or if a required flag is missing. | ||
fn create_algorithm_from_flags(matches: &ArgMatches) -> (&'static str, Box<dyn Digest>, usize) { |
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.
For consistency reasons I would either rename this function to create_algo_from_flags
or rename the existing function detect_algo
to detect_algorithm
src/uu/install/src/install.rs
Outdated
/// | ||
/// Returns an empty Result or an error in case of failure. | ||
/// | ||
fn strip_file(to: &Path, b: &Behavior) -> UResult<()> { | ||
if b.strip && cfg!(not(windows)) { |
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 would move if b.strip
to the copy
function and replace cfg!(not(windows))
with #[cfg(not(windows))]
.
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.
much better, thanks
e44a8d5
to
25fbcd8
Compare
No description provided.