Refactoring and more split-by flexibility.

This commit is contained in:
Andrés N. Robalino
2020-06-17 12:34:26 -05:00
parent 778e497903
commit 9f54d238ba
2 changed files with 57 additions and 4 deletions

View File

@@ -112,17 +112,17 @@ pub fn suggestions(tried: Tagged<&str>, for_value: &Value) -> ShellError {
possible_matches.sort();
if !possible_matches.is_empty() {
return ShellError::labeled_error(
ShellError::labeled_error(
"Unknown column",
format!("did you mean '{}'?", possible_matches[0].1),
tried.tag(),
);
)
} else {
return ShellError::labeled_error(
ShellError::labeled_error(
"Unknown column",
"row does not contain this column",
tried.tag(),
);
)
}
}