diff options
| author | Veetaha <gerzoh1@gmail.com> | 2020-02-09 13:45:06 +0200 |
|---|---|---|
| committer | Veetaha <gerzoh1@gmail.com> | 2020-02-09 13:45:06 +0200 |
| commit | 7a09274e52dc00f7d4e3a040686aa1eb1e075671 (patch) | |
| tree | 8eee4244d9678765d7eae7545a0c9977842f114a /editors/code/src | |
| parent | 34241b9af966208d73f37f1cdf7f862f2590d846 (diff) | |
| download | rust-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.ts | 4 | ||||
| -rw-r--r-- | editors/code/src/installation/fetch_latest_artifact_metadata.ts | 4 |
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 }; |
