Skip to content

Commit 5c98694

Browse files
committed
Rename currentprocess module to process
1 parent f2d9ad8 commit 5c98694

File tree

19 files changed

+51
-51
lines changed

19 files changed

+51
-51
lines changed

src/bin/rustup-init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use rustup::cli::rustup_mode;
2626
#[cfg(windows)]
2727
use rustup::cli::self_update;
2828
use rustup::cli::setup_mode;
29-
use rustup::currentprocess::{process, with, Process};
3029
use rustup::env_var::RUST_RECURSION_COUNT_MAX;
3130
use rustup::is_proxyable_tools;
31+
use rustup::process::{process, with, Process};
3232
use rustup::utils::utils;
3333

3434
fn main() {

src/cli/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ use once_cell::sync::Lazy;
1414

1515
use super::self_update;
1616
use crate::cli::download_tracker::DownloadTracker;
17-
use crate::currentprocess::terminalsource;
1817
use crate::dist::dist::{TargetTriple, ToolchainDesc};
1918
use crate::install::UpdateStatus;
19+
use crate::process::terminalsource;
2020
use crate::utils::notifications as util_notifications;
2121
use crate::utils::notify::NotificationLevel;
2222
use crate::utils::utils;

src/cli/download_tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::io::Write;
44
use std::sync::{Arc, Mutex};
55
use std::time::{Duration, Instant};
66

7-
use crate::currentprocess::{process, terminalsource};
87
use crate::dist::Notification as In;
8+
use crate::process::{process, terminalsource};
99
use crate::utils::units::{Size, Unit, UnitMode};
1010
use crate::utils::Notification as Un;
1111
use crate::Notification;

src/cli/log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::fmt;
22
use std::io::Write;
33

4-
use crate::currentprocess::{process, terminalsource};
4+
use crate::process::{process, terminalsource};
55

66
macro_rules! warn {
77
( $ ( $ arg : tt ) * ) => ( $crate::cli::log::warn_fmt ( format_args ! ( $ ( $ arg ) * ) ) )

src/cli/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::io::Write;
33

44
use pulldown_cmark::{Event, Tag, TagEnd};
55

6-
use crate::currentprocess::terminalsource::{Attr, Color, ColorableTerminal};
6+
use crate::process::terminalsource::{Attr, Color, ColorableTerminal};
77

88
// Handles the wrapping of text written to the console
99
struct LineWrapper<'a> {

src/cli/self_update.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ use anyhow::{anyhow, Context, Result};
5858
use cfg_if::cfg_if;
5959
use same_file::Handle;
6060

61-
use crate::currentprocess::terminalsource;
61+
use crate::process::terminalsource;
6262
use crate::{
6363
cli::{
6464
common::{self, ignorable_error, report_error, Confirm, PackageUpdate},
@@ -1306,18 +1306,18 @@ mod tests {
13061306
use crate::cli::common;
13071307
use crate::dist::dist::PartialToolchainDesc;
13081308
use crate::test::{test_dir, with_rustup_home, Env};
1309-
use crate::{currentprocess, for_host};
1309+
use crate::{for_host, process};
13101310

13111311
#[test]
13121312
fn default_toolchain_is_stable() {
13131313
with_rustup_home(|home| {
13141314
let mut vars = HashMap::new();
13151315
home.apply(&mut vars);
1316-
let tp = currentprocess::TestProcess {
1316+
let tp = process::TestProcess {
13171317
vars,
13181318
..Default::default()
13191319
};
1320-
currentprocess::with(tp.clone().into(), || -> Result<()> {
1320+
process::with(tp.clone().into(), || -> Result<()> {
13211321
// TODO: we could pass in a custom cfg to get notification
13221322
// callbacks rather than output to the tp sink.
13231323
let mut cfg = common::set_globals(false, false).unwrap();
@@ -1360,11 +1360,11 @@ info: default host triple is {0}
13601360
let cargo_home = root_dir.path().join("cargo");
13611361
let mut vars = HashMap::new();
13621362
vars.env("CARGO_HOME", cargo_home.to_string_lossy().to_string());
1363-
let tp = currentprocess::TestProcess {
1363+
let tp = process::TestProcess {
13641364
vars,
13651365
..Default::default()
13661366
};
1367-
currentprocess::with(tp.into(), || -> Result<()> {
1367+
process::with(tp.into(), || -> Result<()> {
13681368
super::install_bins().unwrap();
13691369
Ok(())
13701370
})

src/cli/self_update/windows.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ mod tests {
712712

713713
use rustup_macros::unit_test as test;
714714

715-
use crate::currentprocess;
715+
use crate::process;
716716
use crate::test::with_saved_path;
717717

718718
fn wide(str: &str) -> Vec<u16> {
@@ -753,9 +753,9 @@ mod tests {
753753
#[test]
754754
fn windows_path_regkey_type() {
755755
// per issue #261, setting PATH should use REG_EXPAND_SZ.
756-
let tp = currentprocess::TestProcess::default();
756+
let tp = process::TestProcess::default();
757757
with_saved_path(&mut || {
758-
currentprocess::with(tp.clone().into(), || {
758+
process::with(tp.clone().into(), || {
759759
let root = RegKey::predef(HKEY_CURRENT_USER);
760760
let environment = root
761761
.open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE)
@@ -783,9 +783,9 @@ mod tests {
783783
use std::io;
784784
// during uninstall the PATH key may end up empty; if so we should
785785
// delete it.
786-
let tp = currentprocess::TestProcess::default();
786+
let tp = process::TestProcess::default();
787787
with_saved_path(&mut || {
788-
currentprocess::with(tp.clone().into(), || {
788+
process::with(tp.clone().into(), || {
789789
let root = RegKey::predef(HKEY_CURRENT_USER);
790790
let environment = root
791791
.open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE)
@@ -818,15 +818,15 @@ mod tests {
818818
#[test]
819819
fn windows_doesnt_mess_with_a_non_string_path() {
820820
// This writes an error, so we want a sink for it.
821-
let tp = currentprocess::TestProcess {
821+
let tp = process::TestProcess {
822822
vars: [("HOME".to_string(), "/unused".to_string())]
823823
.iter()
824824
.cloned()
825825
.collect(),
826826
..Default::default()
827827
};
828828
with_saved_path(&mut || {
829-
currentprocess::with(tp.clone().into(), || {
829+
process::with(tp.clone().into(), || {
830830
let root = RegKey::predef(HKEY_CURRENT_USER);
831831
let environment = root
832832
.open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE)
@@ -853,9 +853,9 @@ mod tests {
853853
#[test]
854854
fn windows_treat_missing_path_as_empty() {
855855
// during install the PATH key may be missing; treat it as empty
856-
let tp = currentprocess::TestProcess::default();
856+
let tp = process::TestProcess::default();
857857
with_saved_path(&mut || {
858-
currentprocess::with(tp.clone().into(), || {
858+
process::with(tp.clone().into(), || {
859859
let root = RegKey::predef(HKEY_CURRENT_USER);
860860
let environment = root
861861
.open_subkey_with_flags("Environment", KEY_READ | KEY_WRITE)

src/diskio/test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustup_macros::unit_test as test;
77
use crate::test::test_dir;
88

99
use super::{get_executor, Executor, Item, Kind};
10-
use crate::currentprocess;
10+
use crate::process;
1111

1212
impl Item {
1313
/// The length of the file, for files (for stats)
@@ -23,11 +23,11 @@ fn test_incremental_file(io_threads: &str) -> Result<()> {
2323
let work_dir = test_dir()?;
2424
let mut vars = HashMap::new();
2525
vars.insert("RUSTUP_IO_THREADS".to_string(), io_threads.to_string());
26-
let tp = currentprocess::TestProcess {
26+
let tp = process::TestProcess {
2727
vars,
2828
..Default::default()
2929
};
30-
currentprocess::with(tp.into(), || -> Result<()> {
30+
process::with(tp.into(), || -> Result<()> {
3131
let mut written = 0;
3232
let mut file_finished = false;
3333
let mut io_executor: Box<dyn Executor> = get_executor(None, 32 * 1024 * 1024)?;
@@ -96,11 +96,11 @@ fn test_complete_file(io_threads: &str) -> Result<()> {
9696
let work_dir = test_dir()?;
9797
let mut vars = HashMap::new();
9898
vars.insert("RUSTUP_IO_THREADS".to_string(), io_threads.to_string());
99-
let tp = currentprocess::TestProcess {
99+
let tp = process::TestProcess {
100100
vars,
101101
..Default::default()
102102
};
103-
currentprocess::with(tp.into(), || -> Result<()> {
103+
process::with(tp.into(), || -> Result<()> {
104104
let mut io_executor: Box<dyn Executor> = get_executor(None, 32 * 1024 * 1024)?;
105105
let mut chunk = io_executor.get_buffer(10);
106106
chunk.extend(b"0123456789");

src/diskio/threaded.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl<'a> Executor for Threaded<'a> {
305305
self.tx
306306
.send(Task::Sentinel)
307307
.expect("must still be listening");
308-
if crate::currentprocess::process().var("RUSTUP_DEBUG").is_ok() {
308+
if crate::process::process().var("RUSTUP_DEBUG").is_ok() {
309309
// debug! is in the cli layer. erg. And notification stack is still terrible.
310310
debug!("");
311311
for (bucket, pool) in &self.vec_pools {

src/dist/manifestation/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use url::Url;
1616
use rustup_macros::unit_test as test;
1717

1818
use crate::{
19-
currentprocess,
2019
dist::{
2120
dist::{Profile, TargetTriple, ToolchainDesc, DEFAULT_DIST_SERVER},
2221
download::DownloadCfg,
@@ -26,6 +25,7 @@ use crate::{
2625
temp, Notification,
2726
},
2827
errors::RustupError,
28+
process,
2929
test::mock::{dist::*, MockComponentBuilder, MockFile, MockInstallerBuilder},
3030
utils::{raw as utils_raw, utils},
3131
};
@@ -556,8 +556,8 @@ fn setup_from_dist_server(
556556
},
557557
};
558558

559-
currentprocess::with(
560-
currentprocess::TestProcess::new(
559+
process::with(
560+
process::TestProcess::new(
561561
env::current_dir().unwrap(),
562562
&["rustup"],
563563
HashMap::default(),

0 commit comments

Comments
 (0)