Open linyihai opened 1 day ago
The current design of cargo is that if the members list is in order, then the 'cargo new' command will sort the members list, thus ensuring that the members list is in order.
This is the corresponding code
I had a big list of members, so i need to hack these code to sort the members.
When we added cargo add
to Cargo, we removed a --sort
flag, instead saying formatting control is outside of the scope of that command and should instead live in a dedicated formatter. There is an issue for adding formatting to cargo fmt
and I think that should instead be the focusd
There is an issue for adding formatting to cargo fmt and I think that should instead be the focusd
Yes, after the sorting is done, it actually needs additional formatting.
Sorting is part of formatting, like formatting of use
s in Rust.
Problem
If the list of working interval members is long and unordered, and then append the members via the 'cargo new' command, only manual sorting of the member list can be done.
The current design of cargo is that if the members list is in order, then the 'cargo new' command will sort the members list, thus ensuring that the members list is in order. The current design should be to scramble the contents of the members list, if it was previously out of order. But as I explained earlier, if the user wants to have an ordered list of members, then the user will have to work it out on their own
Proposed Solution
The one I can think of so far is the 'cargo new' subcommand that lets the user choose whether to sort the members list by adding an option.
Notes
No response