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

@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::path::Path;
use crate::{ast::Call, Alias, BlockId, Example, PipelineData, ShellError, Signature};
@ -92,7 +92,7 @@ pub trait Command: Send + Sync + CommandClone {
}
// Is a plugin command (returns plugin's path, type of shell if the declaration is a plugin)
fn is_plugin(&self) -> Option<(&PathBuf, &Option<PathBuf>)> {
fn is_plugin(&self) -> Option<(&Path, Option<&Path>)> {
None
}