mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 08:51:14 -03:00
Remove needless usage of maybe_t
builtin_function() never returns `none()`; this must have been leftover from a previous version of the code.
This commit is contained in:
@@ -222,7 +222,7 @@ static int validate_function_name(int argc, const wchar_t *const *argv, wcstring
|
||||
|
||||
/// Define a function. Calls into `function.cpp` to perform the heavy lifting of defining a
|
||||
/// function.
|
||||
maybe_t<int> builtin_function(parser_t &parser, io_streams_t &streams,
|
||||
int builtin_function(parser_t &parser, io_streams_t &streams,
|
||||
const wcstring_list_t &c_args, const parsed_source_ref_t &source,
|
||||
const ast::block_statement_t &func_node) {
|
||||
assert(source && "Missing source in builtin_function");
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace ast {
|
||||
struct block_statement_t;
|
||||
}
|
||||
|
||||
maybe_t<int> builtin_function(parser_t &parser, io_streams_t &streams,
|
||||
int builtin_function(parser_t &parser, io_streams_t &streams,
|
||||
const wcstring_list_t &c_args, const parsed_source_ref_t &source,
|
||||
const ast::block_statement_t &func_node);
|
||||
#endif
|
||||
|
||||
@@ -393,13 +393,9 @@ end_execution_reason_t parse_execution_context_t::run_function_statement(
|
||||
null_output_stream_t outs;
|
||||
string_output_stream_t errs;
|
||||
io_streams_t streams(outs, errs);
|
||||
int err_code = 0;
|
||||
maybe_t<int> err = builtin_function(*parser, streams, arguments, pstree, statement);
|
||||
if (err) {
|
||||
err_code = err.value();
|
||||
parser->libdata().status_count++;
|
||||
parser->set_last_statuses(statuses_t::just(err_code));
|
||||
}
|
||||
int err_code = builtin_function(*parser, streams, arguments, pstree, statement);
|
||||
parser->libdata().status_count++;
|
||||
parser->set_last_statuses(statuses_t::just(err_code));
|
||||
|
||||
const wcstring &errtext = errs.contents();
|
||||
if (!errtext.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user