mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-23 08:31:16 -03:00
Switch env_var to using maybe_t
This eliminates the "missing" notion of env_var_t. Instead env_get returns a maybe_t<env_var_t>, which forces callers to handle the possibility that the variable is missing.
This commit is contained in:
@@ -201,8 +201,8 @@ static int input_function_args_index = 0;
|
||||
|
||||
/// Return the current bind mode.
|
||||
wcstring input_get_bind_mode() {
|
||||
env_var_t mode = env_get(FISH_BIND_MODE_VAR);
|
||||
return mode.missing() ? DEFAULT_BIND_MODE : mode.as_string();
|
||||
auto mode = env_get(FISH_BIND_MODE_VAR);
|
||||
return mode ? mode->as_string() : DEFAULT_BIND_MODE;
|
||||
}
|
||||
|
||||
/// Set the current bind mode.
|
||||
|
||||
Reference in New Issue
Block a user