about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorVeetaha <gerzoh1@gmail.com>2020-02-09 13:45:06 +0200
committerVeetaha <gerzoh1@gmail.com>2020-02-09 13:45:06 +0200
commit7a09274e52dc00f7d4e3a040686aa1eb1e075671 (patch)
tree8eee4244d9678765d7eae7545a0c9977842f114a /editors/code/src
parent34241b9af966208d73f37f1cdf7f862f2590d846 (diff)
downloadrust-7a09274e52dc00f7d4e3a040686aa1eb1e075671.tar.gz
rust-7a09274e52dc00f7d4e3a040686aa1eb1e075671.zip
vscode: refactor inverted ternaries to if statements as per @matklad
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/config.ts4
-rw-r--r--editors/code/src/installation/fetch_latest_artifact_metadata.ts4
2 files changed, 6 insertions, 2 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index 46394600b02..d5f3da2ed85 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -97,7 +97,9 @@ export class Config {
 
         const prebuiltBinaryName = Config.prebuiltLangServerFileName(process.platform);
 
-        return !prebuiltBinaryName ? null : {
+        if (!prebuiltBinaryName) return null;
+
+        return {
             type: BinarySource.Type.GithubRelease,
             dir: ctx.globalStoragePath,
             file: prebuiltBinaryName,
diff --git a/editors/code/src/installation/fetch_latest_artifact_metadata.ts b/editors/code/src/installation/fetch_latest_artifact_metadata.ts
index f1019e08969..9141c92efe1 100644
--- a/editors/code/src/installation/fetch_latest_artifact_metadata.ts
+++ b/editors/code/src/installation/fetch_latest_artifact_metadata.ts
@@ -26,7 +26,9 @@ export async function fetchLatestArtifactMetadata(
 
     const artifact = response.assets.find(artifact => artifact.name === artifactFileName);
 
-    return !artifact ? null : {
+    if (!artifact) return null;
+
+    return {
         releaseName: response.name,
         downloadUrl: artifact.browser_download_url
     };