Improve readability

This commit is contained in:
memoryruins 2020-01-14 22:52:49 -05:00
parent edb820c329
commit 896a162f55

View file

@ -174,22 +174,19 @@ export class Config {
requireReloadMessage = 'Changing cargo features requires a reload';
}
this.prevCargoFeatures = { ...this.cargoFeatures };
if (
this.prevCargoWatchOptions !== null &&
(this.cargoWatchOptions.enable !==
this.prevCargoWatchOptions.enable ||
this.cargoWatchOptions.command !==
this.prevCargoWatchOptions.command ||
this.cargoWatchOptions.allTargets !==
this.prevCargoWatchOptions.allTargets ||
this.cargoWatchOptions.arguments.length !==
this.prevCargoWatchOptions.arguments.length ||
if (this.prevCargoWatchOptions !== null) {
const changed =
this.cargoWatchOptions.enable !== this.prevCargoWatchOptions.enable ||
this.cargoWatchOptions.command !== this.prevCargoWatchOptions.command ||
this.cargoWatchOptions.allTargets !== this.prevCargoWatchOptions.allTargets ||
this.cargoWatchOptions.arguments.length !== this.prevCargoWatchOptions.arguments.length ||
this.cargoWatchOptions.arguments.some(
(v, i) => v !== this.prevCargoWatchOptions!.arguments[i],
))
) {
requireReloadMessage = 'Changing cargo-watch options requires a reload';
);
if (changed) {
requireReloadMessage = 'Changing cargo-watch options requires a reload';
}
}
this.prevCargoWatchOptions = { ...this.cargoWatchOptions };