Skip to content

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

Closed
@fawni

Description

@fawni

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions