Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Virviil authored and David-OConnor committed Dec 3, 2021
1 parent 9e6c0b8 commit 7415710
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
12 changes: 6 additions & 6 deletions src/actions/install.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::path::{Path, PathBuf};
use std::path::Path;

use termcolor::Color;

Expand All @@ -16,12 +16,12 @@ pub fn install(
git_path: &Path,
paths: &Paths,
found_lock: bool,
packages: &Vec<String>,
packages: &[String],
dev: bool,
lockpacks: &Vec<LockPackage>,
lockpacks: &[LockPackage],
os: &Os,
py_vers: &Version,
lock_path: &PathBuf,
lock_path: &Path,
) {
if !cfg_path.exists() {
cfg.write_file(cfg_path);
Expand All @@ -36,8 +36,8 @@ pub fn install(

let dont_uninstall = util::find_dont_uninstall(&updated_reqs, &up_dev_reqs);

let updated_reqs = process_reqs(updated_reqs, &git_path, paths);
let up_dev_reqs = process_reqs(up_dev_reqs, &git_path, paths);
let updated_reqs = process_reqs(updated_reqs, git_path, paths);
let up_dev_reqs = process_reqs(up_dev_reqs, git_path, paths);

sync(
paths,
Expand Down
6 changes: 3 additions & 3 deletions src/actions/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub fn package(
extras: &[String],
) {
sync(
&paths,
&lockpacks,
paths,
lockpacks,
&cfg.reqs,
&cfg.dev_reqs,
&util::find_dont_uninstall(&cfg.reqs, &cfg.dev_reqs),
Expand All @@ -26,5 +26,5 @@ pub fn package(
lock_path,
);

build::build(&lockpacks, &paths, &cfg, &extras)
build::build(lockpacks, paths, cfg, extras)
}
2 changes: 1 addition & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ setuptools.setup(
]"#;

let actual = serialize_py_list(
&vec![
&[
"Programming Language :: Python :: 3".into(),
"License :: OSI Approved :: MIT License".into(),
"Operating System :: OS Independent".into(),
Expand Down
7 changes: 5 additions & 2 deletions src/dep_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ fn guess_graph(

let mut cleaned_reqs: Vec<Req> = vec![];
for req in reqs {
let names: Vec<String> = cleaned_reqs.iter().map(|cr| cr.name.clone()).collect();
if names.contains(&req.name) {
if cleaned_reqs
.iter()
.map(|cr| cr.name.clone())
.any(|x| x == req.name)
{
for c in cleaned_reqs.iter_mut() {
if c.name == req.name {
for constr in req.constraints.iter() {
Expand Down
8 changes: 4 additions & 4 deletions src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ dev_a = "^1.17.2"
#[test]
fn add_deps_baseline() {
let actual = update_cfg(
BASELINE.into(),
BASELINE,
&[
Req::new("b".into(), base_constrs()),
Req::new("c".into(), base_constrs()),
Expand Down Expand Up @@ -455,7 +455,7 @@ dev_b = "^0.0.1"
#[test]
fn add_deps_no_dev_deps_sect() {
let actual = update_cfg(
BASELINE_NO_DEV_DEPS.into(),
BASELINE_NO_DEV_DEPS,
&[
Req::new("b".into(), base_constrs()),
Req::new("c".into(), base_constrs()),
Expand All @@ -482,7 +482,7 @@ dev_b = "^0.0.1"
#[test]
fn add_deps_baseline_empty_deps() {
let actual = update_cfg(
BASELINE_EMPTY_DEPS.into(),
BASELINE_EMPTY_DEPS,
&[
Req::new("b".into(), base_constrs()),
Req::new("c".into(), base_constrs()),
Expand All @@ -509,7 +509,7 @@ dev_b = "^0.0.1"
#[test]
fn add_deps_dev_deps_baseline_no_deps_dev_deps() {
let actual = update_cfg(
BASELINE_NO_DEPS_NO_DEV_DEPS.into(),
BASELINE_NO_DEPS_NO_DEV_DEPS,
&[
Req::new("b".into(), base_constrs()),
Req::new("c".into(), base_constrs()),
Expand Down
7 changes: 6 additions & 1 deletion src/pyproject/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
use std::{collections::HashMap, fs, path::{Path, PathBuf}, str::FromStr};
use std::{
collections::HashMap,
fs,
path::{Path, PathBuf},
str::FromStr,
};

use regex::Regex;
use serde::Deserialize;
Expand Down

0 comments on commit 7415710

Please sign in to comment.