Skip to content

Commit

Permalink
Upgrade cargo from 0.40 to 0.41
Browse files Browse the repository at this point in the history
Requires a new dependency on cargo-platform
  • Loading branch information
emilk committed Jan 23, 2020
1 parent cca0960 commit 9e5235d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
38 changes: 18 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cargo-geiger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ version = "0.9.0"
maintenance = { status = "experimental" }

[dependencies]
cargo = "0.40.0"
cargo = "0.41.0"
cargo-platform = "0.1.0"
colored = "1.9.0"
console = "0.9.1"
env_logger = "0.7.1"
Expand Down
13 changes: 9 additions & 4 deletions cargo-geiger/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::format::Pattern;
use crate::Args;
use cargo::core::compiler::CompileMode;
use cargo::core::compiler::Executor;
use cargo::core::compiler::ProfileKind;
use cargo::core::compiler::Unit;
use cargo::core::dependency::Kind;
use cargo::core::manifest::TargetKind;
Expand All @@ -29,9 +30,10 @@ use cargo::ops::CleanOptions;
use cargo::ops::CompileOptions;
use cargo::util::paths;
use cargo::util::ProcessBuilder;
use cargo::util::{self, important_paths, CargoResult, Cfg};
use cargo::util::{self, important_paths, CargoResult};
use cargo::CliResult;
use cargo::Config;
use cargo_platform::Cfg;
use colored::Colorize;
use geiger::find_unsafe_in_file;
use geiger::Count;
Expand Down Expand Up @@ -106,7 +108,7 @@ pub struct Graph {

/// TODO: Write proper documentation for this.
/// This function seems to be looking up the active flags for conditional
/// compilation (cargo::util::Cfg instances).
/// compilation (cargo_platform::Cfg instances).
pub fn get_cfgs(
config: &Config,
target: &Option<String>,
Expand All @@ -124,7 +126,9 @@ pub fn get_cfgs(
let output = str::from_utf8(&output.stdout).unwrap();
let lines = output.lines();
Ok(Some(
lines.map(Cfg::from_str).collect::<CargoResult<Vec<_>>>()?,
lines
.map(|s| Cfg::from_str(s).map_err(|e| e.into()))
.collect::<CargoResult<Vec<_>>>()?,
))
}

Expand Down Expand Up @@ -938,7 +942,8 @@ fn resolve_rs_file_deps(
config: &config,
spec: vec![],
target: None,
release: false,
profile_specified: false,
profile_kind: ProfileKind::Release,
doc: false,
};
ops::clean(ws, &clean_opt)
Expand Down
7 changes: 6 additions & 1 deletion cargo-geiger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,12 @@ fn real_main(args: &Args, config: &mut Config) -> CliResult {
let target = if args.all_targets {
None
} else {
Some(args.target.as_ref().unwrap_or(&config_host).as_str())
Some(
args.target
.as_ref()
.map(|s| s.as_str())
.unwrap_or(&config_host),
)
};

let format = Pattern::try_build(&args.format).map_err(|e| {
Expand Down

0 comments on commit 9e5235d

Please sign in to comment.