mirror of
https://github.com/nushell/nushell.git
synced 2025-07-04 16:40:47 +02:00
Add general refactorings (#3996)
This commit is contained in:
@ -83,7 +83,7 @@ pub fn generate_docs(scope: &Scope) -> Value {
|
||||
// Return documentation for each command
|
||||
// Sub-commands are nested under their respective parent commands
|
||||
let mut table = Vec::new();
|
||||
for name in sorted_names.iter() {
|
||||
for name in &sorted_names {
|
||||
// Must be a sub-command, skip since it's being handled underneath when we hit the parent command
|
||||
if !cmap.contains_key(name) {
|
||||
continue;
|
||||
@ -91,7 +91,7 @@ pub fn generate_docs(scope: &Scope) -> Value {
|
||||
let mut row_entries = generate_doc(name, scope);
|
||||
// Iterate over all the subcommands of the parent command
|
||||
let mut sub_table = Vec::new();
|
||||
for sub_name in cmap.get(name).unwrap_or(&Vec::new()).iter() {
|
||||
for sub_name in cmap.get(name).unwrap_or(&Vec::new()) {
|
||||
let sub_row = generate_doc(sub_name, scope);
|
||||
sub_table.push(UntaggedValue::row(sub_row).into_untagged_value());
|
||||
}
|
||||
|
Reference in New Issue
Block a user