Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run basic 2018 edition fix #1583

Merged
merged 1 commit into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

name = "rustup"
version = "1.16.0"
edition = "2018"
authors = [ "Diggory Blake <diggsey@googlemail.com>" ]
description = "Manage multiple rust installations with ease"

Expand Down
1 change: 1 addition & 0 deletions src/download/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

name = "download"
version = "0.4.0"
edition = "2018"
authors = [ "Brian Anderson <banderson@mozilla.com>" ]

license = "MIT/Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/download/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use url::Url;
use std::path::Path;

mod errors;
pub use errors::*;
pub use crate::errors::*;

#[derive(Debug, Copy, Clone)]
pub enum Backend {
Expand Down Expand Up @@ -136,7 +136,7 @@ pub mod curl {
extern crate curl;

use self::curl::easy::Easy;
use errors::*;
use crate::errors::*;
use std::cell::RefCell;
use std::str;
use std::time::Duration;
Expand Down Expand Up @@ -256,7 +256,7 @@ pub mod reqwest_be {

use std::io;
use std::time::Duration;
use errors::*;
use crate::errors::*;
use url::Url;
use super::Event;
use reqwest::{header, Client, Proxy, Response};
Expand Down
2 changes: 1 addition & 1 deletion src/download/tests/download-curl-resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use url::Url;
use download::*;

mod support;
use support::{file_contents, serve_file, tmp_dir, write_file};
use crate::support::{file_contents, serve_file, tmp_dir, write_file};

#[test]
fn partially_downloaded_file_gets_resumed_from_byte_offset() {
Expand Down
2 changes: 1 addition & 1 deletion src/download/tests/download-reqwest-resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use url::Url;
use download::*;

mod support;
use support::{file_contents, serve_file, tmp_dir, write_file};
use crate::support::{file_contents, serve_file, tmp_dir, write_file};

#[test]
fn resume_partial_from_file_url() {
Expand Down
8 changes: 4 additions & 4 deletions src/rustup-cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

use rustup::{self, Cfg, Notification, Toolchain, UpdateStatus};
use rustup::telemetry_analysis::TelemetryAnalysis;
use errors::*;
use crate::errors::*;
use rustup_utils::utils;
use rustup_utils::notify::NotificationLevel;
use self_update;
use crate::self_update;
use std::io::{BufRead, BufReader, Write};
use std::process::{Command, Stdio};
use std::path::Path;
use std::{cmp, iter};
use std::sync::Arc;
use std::time::Duration;
use std;
use term2;
use crate::term2;
use wait_timeout::ChildExt;

pub fn confirm(question: &str, default: bool) -> Result<bool> {
Expand Down Expand Up @@ -104,7 +104,7 @@ pub fn read_line() -> Result<String> {
}

pub fn set_globals(verbose: bool) -> Result<Cfg> {
use download_tracker::DownloadTracker;
use crate::download_tracker::DownloadTracker;
use std::cell::RefCell;

let download_tracker = RefCell::new(DownloadTracker::new());
Expand Down
2 changes: 1 addition & 1 deletion src/rustup-cli/log.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use term2;
use crate::term2;
use std::fmt;
use std::io::Write;

Expand Down
2 changes: 1 addition & 1 deletion src/rustup-cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod help;
use std::alloc::System;
use std::env;
use std::path::PathBuf;
use errors::*;
use crate::errors::*;
use rustup_dist::dist::TargetTriple;
use rustup::env_var::RUST_RECURSION_COUNT_MAX;

Expand Down
8 changes: 4 additions & 4 deletions src/rustup-cli/proxy_mode.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use common::set_globals;
use crate::common::set_globals;
use rustup::Cfg;
use errors::*;
use crate::errors::*;
use rustup_utils::utils::{self, ExitCode};
use rustup::command::run_command_for_dir;
use std::env;
use std::ffi::OsString;
use std::path::PathBuf;
use std::process;
use job;
use crate::job;

pub fn main() -> Result<()> {
::self_update::cleanup_self_updater()?;
crate::self_update::cleanup_self_updater()?;

let ExitCode(c) = {
let _setup = job::setup();
Expand Down
12 changes: 6 additions & 6 deletions src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, Shell, SubCommand};
use common;
use crate::common;
use rustup::{command, Cfg, Toolchain};
use rustup::settings::TelemetryMode;
use errors::*;
use crate::errors::*;
use rustup_dist::manifest::Component;
use rustup_dist::dist::{PartialTargetTriple, PartialToolchainDesc, TargetTriple};
use rustup_utils::utils::{self, ExitCode};
use self_update;
use crate::self_update;
use std::path::Path;
use std::process::{self, Command};
use std::iter;
use std::error::Error;
use term2;
use crate::term2;
use std::io::{self, Write};
use help::*;
use crate::help::*;

pub fn main() -> Result<()> {
::self_update::cleanup_self_updater()?;
crate::self_update::cleanup_self_updater()?;

let ref matches = cli().get_matches();
let verbose = matches.is_present("verbose");
Expand Down
6 changes: 3 additions & 3 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
//! Deleting the running binary during uninstall is tricky
//! and racy on Windows.

use common::{self, Confirm};
use errors::*;
use crate::common::{self, Confirm};
use crate::errors::*;
use rustup_dist::dist;
use rustup_utils::utils;
use rustup::{TOOLS, DUP_TOOLS};
Expand All @@ -42,7 +42,7 @@ use std::path::{Component, Path, PathBuf};
use std::process::{self, Command};
use std::fs;
use tempdir::TempDir;
use term2;
use crate::term2;
use regex::Regex;

pub struct InstallOpts {
Expand Down
6 changes: 3 additions & 3 deletions src/rustup-cli/setup_mode.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::env;
use self_update::{self, InstallOpts};
use errors::*;
use crate::self_update::{self, InstallOpts};
use crate::errors::*;
use clap::{App, AppSettings, Arg};
use rustup_dist::dist::TargetTriple;
use common;
use crate::common;

pub fn main() -> Result<()> {
let args: Vec<_> = env::args().collect();
Expand Down
1 change: 1 addition & 0 deletions src/rustup-dist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

name = "rustup-dist"
version = "1.16.0"
edition = "2018"
authors = [ "Diggory Blake <diggsey@googlemail.com>" ]
description = "Installation from a Rust distribution server"
build = "build.rs"
Expand Down
8 changes: 4 additions & 4 deletions src/rustup-dist/src/component/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/// installation / uninstallation process.

use rustup_utils::utils;
use prefix::InstallPrefix;
use errors::*;
use crate::prefix::InstallPrefix;
use crate::errors::*;

use component::transaction::Transaction;
use component::package::{INSTALLER_VERSION, VERSION_FILE};
use crate::component::transaction::Transaction;
use crate::component::package::{INSTALLER_VERSION, VERSION_FILE};

use std::path::{Path, PathBuf};
use std::fs::File;
Expand Down
8 changes: 4 additions & 4 deletions src/rustup-dist/src/component/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ extern crate flate2;
extern crate tar;
extern crate xz2;

use component::components::*;
use component::transaction::*;
use crate::component::components::*;
use crate::component::transaction::*;

use errors::*;
use crate::errors::*;
use rustup_utils::utils;
use temp;
use crate::temp;

use std::path::{Path, PathBuf};
use std::collections::HashSet;
Expand Down
8 changes: 4 additions & 4 deletions src/rustup-dist/src/component/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
//! does not remove any dirs created by it.

use rustup_utils::utils;
use temp;
use prefix::InstallPrefix;
use errors::*;
use notifications::*;
use crate::temp;
use crate::prefix::InstallPrefix;
use crate::errors::*;
use crate::notifications::*;

use std::fs::File;
use std::path::{Path, PathBuf};
Expand Down
2 changes: 1 addition & 1 deletion src/rustup-dist/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use toml;

use rustup_utils::toml_utils::*;
use errors::*;
use crate::errors::*;
use super::manifest::Component;

pub const SUPPORTED_CONFIG_VERSIONS: [&'static str; 1] = ["1"];
Expand Down
16 changes: 8 additions & 8 deletions src/rustup-dist/src/dist.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use temp;
use errors::*;
use notifications::*;
use crate::temp;
use crate::errors::*;
use crate::notifications::*;
use rustup_utils::{self, utils};
use prefix::InstallPrefix;
use manifest::Component;
use manifest::Manifest as ManifestV2;
use manifestation::{Changes, Manifestation, UpdateStatus};
use download::DownloadCfg;
use crate::prefix::InstallPrefix;
use crate::manifest::Component;
use crate::manifest::Manifest as ManifestV2;
use crate::manifestation::{Changes, Manifestation, UpdateStatus};
use crate::download::DownloadCfg;

use std::path::Path;
use std::fmt;
Expand Down
6 changes: 3 additions & 3 deletions src/rustup-dist/src/download.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustup_utils::utils;
use errors::*;
use temp;
use notifications::*;
use crate::errors::*;
use crate::temp;
use crate::notifications::*;
use sha2::{Digest, Sha256};
use url::Url;

Expand Down
4 changes: 2 additions & 2 deletions src/rustup-dist/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::path::PathBuf;
use std::io::{self, Write};
use temp;
use crate::temp;
use toml;
use rustup_utils;
use manifest::{Component, Manifest};
use crate::manifest::{Component, Manifest};

error_chain! {
links {
Expand Down
4 changes: 2 additions & 2 deletions src/rustup-dist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ extern crate winapi;
#[cfg(windows)]
extern crate winreg;

pub use errors::*;
pub use notifications::Notification;
pub use crate::errors::*;
pub use crate::notifications::Notification;

pub mod temp;

Expand Down
4 changes: 2 additions & 2 deletions src/rustup-dist/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
//!
//! See tests/channel-rust-nightly-example.toml for an example.

use errors::*;
use crate::errors::*;
use toml;
use rustup_utils::toml_utils::*;

use std::collections::HashMap;
use dist::TargetTriple;
use crate::dist::TargetTriple;

pub const SUPPORTED_MANIFEST_VERSIONS: [&'static str; 1] = ["2"];
pub const DEFAULT_MANIFEST_VERSION: &'static str = "2";
Expand Down
20 changes: 10 additions & 10 deletions src/rustup-dist/src/manifestation.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//! Maintains a Rust installation by installing individual Rust
//! platform components from a distribution server.

use config::Config;
use manifest::{Component, Manifest, TargetedPackage};
use dist::{TargetTriple, DEFAULT_DIST_SERVER};
use component::{Components, Package, TarGzPackage, TarXzPackage, Transaction};
use temp;
use errors::*;
use notifications::*;
use crate::config::Config;
use crate::manifest::{Component, Manifest, TargetedPackage};
use crate::dist::{TargetTriple, DEFAULT_DIST_SERVER};
use crate::component::{Components, Package, TarGzPackage, TarXzPackage, Transaction};
use crate::temp;
use crate::errors::*;
use crate::notifications::*;
use rustup_utils::utils;
use download::{DownloadCfg, File};
use prefix::InstallPrefix;
use crate::download::{DownloadCfg, File};
use crate::prefix::InstallPrefix;
use std::path::Path;

pub const DIST_MANIFEST: &'static str = "multirust-channel-manifest.toml";
Expand Down Expand Up @@ -600,7 +600,7 @@ impl Update {
let mut unavailable_components: Vec<Component> = self.components_to_install
.iter()
.filter(|c| {
use manifest::*;
use crate::manifest::*;
let pkg: Option<&Package> = new_manifest.get_package(&c.short_name_in_manifest()).ok();
let target_pkg: Option<&TargetedPackage> =
pkg.and_then(|p| p.get_target(c.target.as_ref()).ok());
Expand Down
6 changes: 3 additions & 3 deletions src/rustup-dist/src/notifications.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::path::Path;
use std::fmt::{self, Display};
use temp;
use crate::temp;
use rustup_utils;
use rustup_utils::notify::NotificationLevel;
use dist::TargetTriple;
use errors::*;
use crate::dist::TargetTriple;
use crate::errors::*;

#[derive(Debug)]
pub enum Notification<'a> {
Expand Down
1 change: 1 addition & 0 deletions src/rustup-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

name = "rustup-mock"
version = "1.16.0"
edition = "2018"
authors = [ "Diggory Blake <diggsey@googlemail.com>" ]
description = "Test mocks for rustup"

Expand Down
4 changes: 2 additions & 2 deletions src/rustup-mock/src/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use std::process::{Command, Stdio};
use std::sync::Arc;
use std::time::Duration;
use tempdir::TempDir;
use {MockComponentBuilder, MockFile, MockInstallerBuilder};
use dist::{change_channel_date, ManifestVersion, MockChannel, MockComponent, MockDistServer,
use crate::{MockComponentBuilder, MockFile, MockInstallerBuilder};
use crate::dist::{change_channel_date, ManifestVersion, MockChannel, MockComponent, MockDistServer,
MockPackage, MockTargetedPackage};
use url::Url;
use wait_timeout::ChildExt;
Expand Down
Loading