&Option<T> -> Option<&T> (#11091)

* refactor `starting_request_args` to only `ref` non-`Copy`

* refactor `needs_recompile` to only `ref` non-`Copy`

* refactor `add_workspace_folder` to only `ref` `Some`

---------

Co-authored-by: Rudxain <rudxain@localhost.localdomain>
This commit is contained in:
Ricardo Fernández Serrata 2024-07-09 05:34:28 -04:00 committed by GitHub
parent 0c8d51ee36
commit 6997ee9151
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 8 deletions

View file

@ -422,7 +422,7 @@ fn build_tree_sitter_library(
}
}
let recompile = needs_recompile(&library_path, &parser_path, &scanner_path)
let recompile = needs_recompile(&library_path, &parser_path, scanner_path.as_ref())
.context("Failed to compare source and binary timestamps")?;
if !recompile {
@ -568,7 +568,7 @@ fn build_tree_sitter_library(
fn needs_recompile(
lib_path: &Path,
parser_c_path: &Path,
scanner_path: &Option<PathBuf>,
scanner_path: Option<&PathBuf>,
) -> Result<bool> {
if !lib_path.exists() {
return Ok(true);