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:
parent
df9c2aefb1
commit
05fc0c432c
239 changed files with 854 additions and 1015 deletions
|
@ -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,
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue