Skip to content

Commit

Permalink
Use edition 2018.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Sep 24, 2019
1 parent 6b85298 commit bcad053
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 42 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license = "MIT OR Apache-2.0"
name = "cross"
repository = "https://github.com/rust-embedded/cross"
version = "0.1.16"
edition = "2018"

[dependencies]
atty = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::path::{Path, PathBuf};
use std::process::{Command, ExitStatus};
use std::{env, fs};

use errors::*;
use extensions::CommandExt;
use crate::errors::*;
use crate::extensions::CommandExt;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Subcommand {
Expand Down
6 changes: 3 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::env;

use Target;
use cargo::Subcommand;
use rustc::TargetList;
use crate::Target;
use crate::cargo::Subcommand;
use crate::rustc::TargetList;

pub struct Args {
pub all: Vec<String>,
Expand Down
12 changes: 7 additions & 5 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ use std::process::{Command, ExitStatus};
use std::{env, fs};

use atty::Stream;
use error_chain::bail;
use lazy_static::lazy_static;
use semver::{Version, VersionReq};

use {Target, Toml};
use cargo::Root;
use errors::*;
use extensions::CommandExt;
use id;
use crate::{Target, Toml};
use crate::cargo::Root;
use crate::errors::*;
use crate::extensions::CommandExt;
use crate::id;

const DOCKER_IMAGES: &[&str] = &include!(concat!(env!("OUT_DIR"), "/docker-images.rs"));

Expand Down
2 changes: 2 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unused_doc_comments)]

use error_chain::error_chain;

error_chain!();
2 changes: 1 addition & 1 deletion src/extensions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::process::{Command, ExitStatus};

use errors::*;
use crate::errors::*;

pub trait CommandExt {
fn run(&mut self, verbose: bool) -> Result<()>;
Expand Down
2 changes: 1 addition & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fs::File;
use std::io::Read;
use std::path::Path;

use errors::*;
use crate::errors::*;

pub fn read<P>(path: P) -> Result<String>
where P: AsRef<Path>
Expand Down
6 changes: 3 additions & 3 deletions src/interpreter.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::path::Path;

use errors::*;
use file;
use Target;
use crate::errors::*;
use crate::file;
use crate::Target;

/// Checks if the interpreters have been registered in the host system
pub fn is_registered(target: &Target) -> Result<bool> {
Expand Down
27 changes: 6 additions & 21 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
#![deny(missing_debug_implementations)]

extern crate atty;
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate lazy_static;
extern crate libc;
extern crate rustc_version;
extern crate semver;
extern crate toml;

#[cfg(not(target_os = "windows"))]
extern crate nix;

#[cfg(target_os = "windows")]
extern crate winapi;
#![deny(missing_debug_implementations, rust_2018_idioms)]

mod cargo;
mod cli;
Expand All @@ -31,14 +15,15 @@ use std::io::Write;
use std::process::ExitStatus;
use std::{env, io, process};

use error_chain::bail;
use toml::{Value, value::Table};

use cargo::{Root, Subcommand};
use errors::*;
use rustc::{TargetList, VersionMetaExt};
use self::cargo::{Root, Subcommand};
use self::errors::*;
use self::rustc::{TargetList, VersionMetaExt};

#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, PartialEq)]
pub enum Host {
Other,

Expand Down
6 changes: 3 additions & 3 deletions src/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use std::process::Command;

use rustc_version::{Version, VersionMeta};

use {Host, Target};
use errors::*;
use extensions::CommandExt;
use crate::{Host, Target};
use crate::errors::*;
use crate::extensions::CommandExt;

pub struct TargetList {
triples: Vec<String>,
Expand Down
6 changes: 3 additions & 3 deletions src/rustup.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::process::Command;

use Target;
use errors::*;
use extensions::CommandExt;
use crate::Target;
use crate::errors::*;
use crate::extensions::CommandExt;

#[derive(Debug)]
pub struct AvailableTargets {
Expand Down

0 comments on commit bcad053

Please sign in to comment.