Invert &Options 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:
Stefan Holderbach
2023-09-13 01:00:58 +02:00
committed by GitHub
parent 3e14dc3eb8
commit a14e9e0a2e
24 changed files with 87 additions and 83 deletions

View File

@ -3595,13 +3595,14 @@ pub fn parse_register(working_set: &mut StateWorkingSet, spans: &[Span]) -> Pipe
let signatures = signature.map_or_else(
|| {
let signatures = get_signature(&path, &shell, &current_envs).map_err(|err| {
ParseError::LabeledError(
"Error getting signatures".into(),
err.to_string(),
spans[0],
)
});
let signatures =
get_signature(&path, shell.as_deref(), &current_envs).map_err(|err| {
ParseError::LabeledError(
"Error getting signatures".into(),
err.to_string(),
spans[0],
)
});
if signatures.is_ok() {
// mark plugins file as dirty only when the user is registering plugins