From 1bddd635c50a5c97447ba61bae5d616defe6ce91 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 5 Dec 2023 12:30:55 -0600 Subject: [PATCH] 6 --- xtask/src/runchecks.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/xtask/src/runchecks.rs b/xtask/src/runchecks.rs index 6abc7a9b5f..47db57f2fe 100644 --- a/xtask/src/runchecks.rs +++ b/xtask/src/runchecks.rs @@ -59,6 +59,16 @@ fn rustup(args: &[&str]) { endgroup!(); } +fn add_nightly() { + rustup(&[ + "component", + "add", + "rust-src", + "--toolchain", + "nightly-2023-07-01", + ]) +} + // Define and run a cargo command fn run_cargo(command: &str, params: Params, error: &str) { run_cargo_with_path::(command, params, None, error) @@ -79,13 +89,7 @@ fn run_cargo_with_path>( .unwrap() .ends_with("examples/train-web/train") { - rustup(&[ - "component", - "add", - "rust-src", - "--toolchain", - "nightly-2023-07-01", - ]); + add_nightly(); vec!["+nightly-2023-07-01"] } else { vec![] @@ -426,13 +430,7 @@ fn check_typos() { } fn check_examples() { - rustup(&[ - "component", - "add", - "rust-src", - "--toolchain", - "nightly-2023-07-01", - ]); + add_nightly(); let workspaces = get_workspaces(WorkspaceMemberType::Example); for workspace in workspaces { if workspace.name == "notebook" {