Fix a bunch of other low-hanging style lints (#36498)

- **Fix a bunch of low hanging style lints like unnecessary-return**
- **Fix single worktree violation**
- **And the rest**

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 21:26:17 +02:00 committed by GitHub
parent df9c2aefb1
commit 05fc0c432c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
239 changed files with 854 additions and 1015 deletions

View file

@ -17,7 +17,7 @@ impl GlslExtension {
}
if let Some(path) = &self.cached_binary_path
&& fs::metadata(path).map_or(false, |stat| stat.is_file())
&& fs::metadata(path).is_ok_and(|stat| stat.is_file())
{
return Ok(path.clone());
}
@ -60,7 +60,7 @@ impl GlslExtension {
.map_err(|err| format!("failed to create directory '{version_dir}': {err}"))?;
let binary_path = format!("{version_dir}/bin/glsl_analyzer");
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
zed::set_language_server_installation_status(
language_server_id,
&zed::LanguageServerInstallationStatus::Downloading,

View file

@ -13,7 +13,7 @@ struct HtmlExtension {
impl HtmlExtension {
fn server_exists(&self) -> bool {
fs::metadata(SERVER_PATH).map_or(false, |stat| stat.is_file())
fs::metadata(SERVER_PATH).is_ok_and(|stat| stat.is_file())
}
fn server_script_path(&mut self, language_server_id: &LanguageServerId) -> Result<String> {

View file

@ -39,7 +39,7 @@ impl RuffExtension {
}
if let Some(path) = &self.cached_binary_path
&& fs::metadata(path).map_or(false, |stat| stat.is_file())
&& fs::metadata(path).is_ok_and(|stat| stat.is_file())
{
return Ok(RuffBinary {
path: path.clone(),
@ -94,7 +94,7 @@ impl RuffExtension {
_ => format!("{version_dir}/{asset_stem}/ruff"),
};
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
zed::set_language_server_installation_status(
language_server_id,
&zed::LanguageServerInstallationStatus::Downloading,

View file

@ -18,7 +18,7 @@ impl SnippetExtension {
}
if let Some(path) = &self.cached_binary_path
&& fs::metadata(path).map_or(false, |stat| stat.is_file())
&& fs::metadata(path).is_ok_and(|stat| stat.is_file())
{
return Ok(path.clone());
}
@ -59,7 +59,7 @@ impl SnippetExtension {
let version_dir = format!("simple-completion-language-server-{}", release.version);
let binary_path = format!("{version_dir}/simple-completion-language-server");
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
zed::set_language_server_installation_status(
language_server_id,
&zed::LanguageServerInstallationStatus::Downloading,

View file

@ -19,7 +19,7 @@ impl TestExtension {
println!("{}", String::from_utf8_lossy(&echo_output.stdout));
if let Some(path) = &self.cached_binary_path
&& fs::metadata(path).map_or(false, |stat| stat.is_file())
&& fs::metadata(path).is_ok_and(|stat| stat.is_file())
{
return Ok(path.clone());
}
@ -61,7 +61,7 @@ impl TestExtension {
let version_dir = format!("gleam-{}", release.version);
let binary_path = format!("{version_dir}/gleam");
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
zed::set_language_server_installation_status(
language_server_id,
&zed::LanguageServerInstallationStatus::Downloading,

View file

@ -40,7 +40,7 @@ impl TomlExtension {
}
if let Some(path) = &self.cached_binary_path
&& fs::metadata(path).map_or(false, |stat| stat.is_file())
&& fs::metadata(path).is_ok_and(|stat| stat.is_file())
{
return Ok(TaploBinary {
path: path.clone(),
@ -93,7 +93,7 @@ impl TomlExtension {
}
);
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
if !fs::metadata(&binary_path).is_ok_and(|stat| stat.is_file()) {
zed::set_language_server_installation_status(
language_server_id,
&zed::LanguageServerInstallationStatus::Downloading,