Repository: casey/just
File: src/config.rs (Rust)

Code before:
      }
    } else if matches.is_present(cmd::VARIABLES) {
      Subcommand::Variables
    } else {
      Subcommand::Run {
        arguments: positional.arguments,
        overrides,
      }
    };

    let shell_args = if matches.occurrences_of(arg::SHELL_ARG) > 0
      || matches.occurrences_of(arg::CLEAR_SHELL_ARGS) > 0
    {
      Some(
        matches
          .values_of(arg::SHELL_ARG)
          .map_or(Vec::new(), |shell_args| {
            shell_args.map(str::to_owned).collect()
          }),
      )
    } else {
      None
    };

    let unstable = matches.is_present(arg::UNSTABLE)
      || std::env::var_os(UNSTABLE_KEY).map_or(false, |val| val.to_string_lossy() == "true");

    Ok(Self {
      check: matches.is_present(arg::CHECK),
      dry_run: matches.is_present(arg::DRY_RUN),
      dump_format: Self::dump_format_from_matches(matches)?,
      highlight: !matches.is_present(arg::NO_HIGHLIGHT),
      shell: matches.value_of(arg::SHELL).map(str::to_owned),
      load_dotenv: !matches.is_present(arg::NO_DOTENV),
      shell_command: matches.is_present(arg::SHELL_COMMAND),
      unsorted: matches.is_present(arg::UNSORTED),
      unstable,
      list_heading: matches
        .value_of(arg::LIST_HEADING)
        .unwrap_or("Available recipes:\n")
        .to_owned(),
      list_prefix: matches
        .value_of(arg::LIST_PREFIX)
        .unwrap_or("    ")
        .to_owned(),
      color,
      invocation_directory,
      search_config,
      shell_args,
      subcommand,
      dotenv_filename: matches.value_of(arg::DOTENV_FILENAME).map(str::to_owned),

Review comment (suggestion):
I'd be inclined to inline this:
```suggestion
      || std::env::var_os("JUST_UNSTABLE").map_or(false, |val| val.to_string_lossy() == "true");
```

Code after:
      Subcommand::Variables
    } else {
      Subcommand::Run {
        arguments: positional.arguments,
        overrides,
      }
    };

    let shell_args = if matches.occurrences_of(arg::SHELL_ARG) > 0
      || matches.occurrences_of(arg::CLEAR_SHELL_ARGS) > 0
    {
      Some(
        matches
          .values_of(arg::SHELL_ARG)
          .map_or(Vec::new(), |shell_args| {
            shell_args.map(str::to_owned).collect()
          }),
      )
    } else {
      None
    };

    let unstable = matches.is_present(arg::UNSTABLE)
      || std::env::var_os("JUST_UNSTABLE")
        .map(|val| !(val == "false" || val == "0" || val.is_empty()))
        .unwrap_or_default();

    Ok(Self {
      check: matches.is_present(arg::CHECK),
      dry_run: matches.is_present(arg::DRY_RUN),
      dump_format: Self::dump_format_from_matches(matches)?,
      highlight: !matches.is_present(arg::NO_HIGHLIGHT),
      shell: matches.value_of(arg::SHELL).map(str::to_owned),
      load_dotenv: !matches.is_present(arg::NO_DOTENV),
      shell_command: matches.is_present(arg::SHELL_COMMAND),
      unsorted: matches.is_present(arg::UNSORTED),
      unstable,
      list_heading: matches
        .value_of(arg::LIST_HEADING)
        .unwrap_or("Available recipes:\n")
        .to_owned(),
      list_prefix: matches
        .value_of(arg::LIST_PREFIX)
        .unwrap_or("    ")
        .to_owned(),
      color,
      invocation_directory,
      search_config,
      shell_args,
      subcommand,
      dotenv_filename: matches.value_of(arg::DOTENV_FILENAME).map(str::to_owned),