mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Invert &Option
s to Option<&T>
(#10315)
Elide the reference for `Copy` type (`usize`) Use the canonical deref where possible. * `&Box` -> `&` * `&String` -> `&str` * `&PathBuf` -> `&Path` Skips the ctrl-C handler for now.
This commit is contained in:
committed by
GitHub
parent
3e14dc3eb8
commit
a14e9e0a2e
@ -210,7 +210,7 @@ pub(crate) fn set_config_path(
|
||||
cwd: &Path,
|
||||
default_config_name: &str,
|
||||
key: &str,
|
||||
config_file: &Option<Spanned<String>>,
|
||||
config_file: Option<&Spanned<String>>,
|
||||
) {
|
||||
let config_path = match config_file {
|
||||
Some(s) => canonicalize_with(&s.item, cwd).ok(),
|
||||
|
@ -129,7 +129,7 @@ fn main() -> Result<()> {
|
||||
&init_cwd,
|
||||
"config.nu",
|
||||
"config-path",
|
||||
&parsed_nu_cli_args.config_file,
|
||||
parsed_nu_cli_args.config_file.as_ref(),
|
||||
);
|
||||
|
||||
set_config_path(
|
||||
@ -137,7 +137,7 @@ fn main() -> Result<()> {
|
||||
&init_cwd,
|
||||
"env.nu",
|
||||
"env-path",
|
||||
&parsed_nu_cli_args.env_file,
|
||||
parsed_nu_cli_args.env_file.as_ref(),
|
||||
);
|
||||
perf(
|
||||
"set_config_path",
|
||||
|
Reference in New Issue
Block a user