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

Commit 720d53e

Browse files
committed
fix: remove excess async from the functions that return a Promise
1 parent 27d2381 commit 720d53e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/dist-fetch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function manifest_includes_rls(manifest) {
1717
* @param {string} [channel] Defaults to `nightly`
1818
* @returns {Promise<string>} Toolchain name
1919
*/
20-
async function checkDatedDistHasRls(date, channel = "nightly") {
20+
function checkDatedDistHasRls(date, channel = "nightly") {
2121
const dateString = _.isString(date) ? date : date.toISOString().split("T")[0]
2222
const cacheKey = `${channel}-${dateString}`
2323

@@ -56,7 +56,7 @@ async function checkDatedDistHasRls(date, channel = "nightly") {
5656
* @param {string} [channel] Defaults to `nightly`
5757
* @returns {Promise<string>} Latest channel dated version with rls-preview
5858
*/
59-
async function fetchLatestDatedDistWithRls(channel) {
59+
function fetchLatestDatedDistWithRls(channel) {
6060
const aDayMillis = 24 * 60 * 60 * 1000
6161
const minDate = new Date(Date.now() - 30 * aDayMillis)
6262

@@ -83,7 +83,7 @@ async function fetchLatestDatedDistWithRls(channel) {
8383
* @param {string} [arg.currentVersion] Current installed rustc version
8484
* @returns {Promise<?string>} New version of update available (falsy otherwise)
8585
*/
86-
async function fetchLatestDist({ toolchain, currentVersion = "none" }) {
86+
function fetchLatestDist({ toolchain, currentVersion = "none" }) {
8787
return new Promise((resolve, reject) => {
8888
https
8989
.get(`https://static.rust-lang.org/dist/channel-rust-${toolchain}.toml`, (res) => {
@@ -119,7 +119,7 @@ async function fetchLatestDist({ toolchain, currentVersion = "none" }) {
119119
* @param {string} toolchain
120120
* @returns {Promise<boolean>}
121121
*/
122-
async function checkHasRls(toolchain) {
122+
function checkHasRls(toolchain) {
123123
const dated = toolchain.match(DATED_REGEX)
124124
if (dated) {
125125
return checkDatedDistHasRls(dated[2], dated[1])

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { showConflictingPackageWarnings } = require("./competition.js")
1010
/** @type {number} interval Between toolchain update checks, milliseconds */
1111
const PERIODIC_UPDATE_CHECK_MILLIS = 6 * 60 * 60 * 1000
1212

13-
async function exec(command, { cwd } = {}) {
13+
function exec(command, { cwd } = {}) {
1414
return new Promise((resolve, reject) => {
1515
const env = process.env
1616
env.PATH = envPath()

lib/rust-project.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class RustProject {
126126
* @returns {function} Async function
127127
*/
128128
function callbackAsync(functionWithCallback) {
129-
return async (...args) => {
129+
return (...args) => {
130130
return new Promise((resolve, reject) => {
131131
functionWithCallback(...args, (err, ...out) => {
132132
if (err) {

0 commit comments

Comments
 (0)