Skip to content

Commit

Permalink
Merge pull request #165 from jmcconnell26/ISSUE-69-CleanupTestOnlyTrait
Browse files Browse the repository at this point in the history
ISSUE-16 - Cleanup a trait only used in a unit test module
  • Loading branch information
anderejd committed Dec 17, 2020
2 parents 91594c9 + 19043c6 commit ba85801
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion cargo-geiger/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ fn parse_features(raw_features: Option<String>) -> Vec<String> {
pub mod args_tests {
use super::*;

use cargo::core::shell::ColorChoice;
use cargo::core::Verbosity;
use rstest::*;
use std::ffi::OsString;
Expand Down
5 changes: 0 additions & 5 deletions cargo-geiger/src/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod krates;
mod metadata;

use ::krates::Krates;
use cargo::core::dependency::DepKind;
use cargo_metadata::Metadata;
use std::collections::HashSet;
use std::path::PathBuf;
Expand Down Expand Up @@ -69,10 +68,6 @@ pub trait QueryResolve {
fn query_resolve(&self, query: &str) -> Option<cargo_metadata::PackageId>;
}

pub trait ToCargoCoreDepKind {
fn to_cargo_core_dep_kind(&self) -> DepKind;
}

pub trait ToCargoGeigerDependencyKind {
fn to_cargo_geiger_dependency_kind(
&self,
Expand Down
13 changes: 10 additions & 3 deletions cargo-geiger/src/mapping/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,23 @@ impl ToCargoMetadataPackage for cargo_metadata::PackageId {
mod metadata_tests {
use super::*;

use super::super::{
GetPackageNameFromCargoMetadataPackageId, ToCargoCoreDepKind,
};
use super::super::GetPackageNameFromCargoMetadataPackageId;

use crate::args::FeaturesArgs;
use crate::cli::get_workspace;

// ISSUE-69 - These dependencies are used for testing only, to confirm
// that the changes made for ISSUE-16 retain feature parity. A discussion can
// be had about if it is worth keeping these in and paying the corresponding
// cost in compile time when building tests
use cargo::core::dependency::DepKind;
use cargo::core::registry::PackageRegistry;
use cargo::core::resolver::ResolveOpts;
use cargo::core::{
Package, PackageId, PackageIdSpec, PackageSet, Resolve, Workspace,
};
use cargo::{ops, CargoResult, Config};

use cargo_metadata::{CargoOpt, Metadata, MetadataCommand};
use krates::Builder as KratesBuilder;
use rstest::*;
Expand Down Expand Up @@ -343,6 +346,10 @@ mod metadata_tests {
Ok((packages, resolve))
}

trait ToCargoCoreDepKind {
fn to_cargo_core_dep_kind(&self) -> DepKind;
}

impl ToCargoCoreDepKind for DependencyKind {
fn to_cargo_core_dep_kind(&self) -> DepKind {
match self {
Expand Down

0 comments on commit ba85801

Please sign in to comment.