Skip to content

Commit

Permalink
Merge pull request #8 from barskern/2018-edition
Browse files Browse the repository at this point in the history
Update to 2018 edition
  • Loading branch information
barskern authored Feb 2, 2019
2 parents 1a065d1 + ae57183 commit b1ec779
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "cargo-with"
version = "0.2.0"
edition = "2018"
authors = ["cbourjau <[email protected]>"]
categories = [
"development-tools",
Expand All @@ -23,9 +24,8 @@ repository = "https://github.com/cbourjau/cargo-with"

[dependencies]
clap = "2.32"
env_logger = "0.5.13"
env_logger = "0.6.0"
failure = "0.1.3"
log = "0.4.5"
serde = "1.0"
serde_derive = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
4 changes: 3 additions & 1 deletion src/cargo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use failure::{err_msg, format_err, Error};
use log::debug;
use serde::Deserialize;

use std::path::PathBuf;
use std::process::Command;
Expand Down Expand Up @@ -160,7 +162,7 @@ enum TargetKind {
}

impl std::fmt::Display for TargetKind {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let name = match *self {
TargetKind::Example => "example",
TargetKind::Test => "test",
Expand Down
16 changes: 4 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
extern crate clap;
extern crate env_logger;
extern crate failure;
#[macro_use]
extern crate log;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;

use clap::{App, AppSettings, Arg, SubCommand};
use failure::{err_msg, Error};
use log::debug;

mod cargo;
mod runner;
use runner::runner;

use crate::runner::runner;

const COMMAND_NAME: &str = "with";
const COMMAND_DESCRIPTION: &str =
Expand All @@ -33,7 +25,7 @@ fn main() -> Result<(), Error> {
}

fn process_matches<'a>(
matches: &'a clap::ArgMatches,
matches: &'a clap::ArgMatches<'_>,
) -> Result<
(
impl Iterator<Item = &'a str> + Clone,
Expand Down
7 changes: 4 additions & 3 deletions src/runner.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use failure::{err_msg, Error};
use log::debug;

use std::iter::once;
use std::process::Command;

use failure::{err_msg, Error};

use cargo;
use crate::cargo;

/// `cargo_cmd_iter` is an iterator over the cargo subcommand with arguments
/// `cmd_iter` is an iterator over the the command to run the binary with
Expand Down

0 comments on commit b1ec779

Please sign in to comment.