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

--dirs-first flag does nothing if no SortType is specified #65

Closed
fawni opened this issue Mar 13, 2023 · 1 comment · Fixed by #67
Closed

--dirs-first flag does nothing if no SortType is specified #65

fawni opened this issue Mar 13, 2023 · 1 comment · Fixed by #67

Comments

@fawni
Copy link
Contributor

fawni commented Mar 13, 2023

for example: et --dirs-first will not sort directories above files, but if sort type is specified: et --dirs-first -s name it works as expected.

i was able to produce the expected behavior by adding a None enum variant to SortType and adding:

} else if ctx.dirs_first() {
	Order::from((SortType::None, true))
		.comparator()
		.map(|func| current_node.sort_children(func));
}

to this line, but there are probably "cleaner" approaches.

also, i noticed that clippy suggests a bunch of stylistic refactors all over. do you have an opinion against such stylistic approaches?

@solidiquis
Copy link
Owner

I do not, but if you plan to open a PR if you could pass on running clippy that'd be awesome. Someone has another PR that's currently waiting to be merged and they ran clippy and I'd be worried about really gnarly merge conflicts that could cause headaches. Thanks for looking into this btw!

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 a pull request may close this issue.

2 participants