Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 28c1d53

Browse files
committed
fix: use if
1 parent a84d542 commit 28c1d53

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ function exec(command, { cwd } = {}) {
2626
}
2727

2828
function logErr(e, logFn = console.warn) {
29-
e && logFn(`${e}`)
29+
if (e) {
30+
logFn(`${e}`)
31+
}
3032
}
3133

3234
function clearIdeRustNotifications(prefix = "ide-rust") {
@@ -307,11 +309,12 @@ class RustLanguageClient extends AutoLanguageClient {
307309
.then(() => this._restartLanguageServers(`Updated rust toolchain`))
308310
.catch((e) => {
309311
logErr(e)
310-
e &&
312+
if (e) {
311313
atom.notifications.addError(`\`rustup update ${toolchain}\` failed`, {
312314
detail: e,
313315
dismissable: true,
314316
})
317+
}
315318
})
316319

317320
if (this.busySignalService) {
@@ -413,7 +416,7 @@ class RustLanguageClient extends AutoLanguageClient {
413416
.catch(logErr)
414417
}
415418
} catch (e) {
416-
e && console.warn(e)
419+
console.warn(e)
417420
}
418421
}
419422

lib/rust-project.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class RustProject {
3636
this.server.process.on("exit", () => {
3737
this._progress.forEach((msg) => msg.dispose())
3838
this._progress.clear()
39-
this._rustDocBusyMessage && this._rustDocBusyMessage.dispose()
39+
if (this._rustDocBusyMessage) {
40+
this._rustDocBusyMessage.dispose()
41+
}
4042
})
4143
}
4244

0 commit comments

Comments
 (0)