Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add private git server support #353

Merged
merged 7 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix clippy lints
  • Loading branch information
Jake-Shadle committed Jul 16, 2021
commit 483ce02fc35c46efec198ec498cdffa65c8c954f
7 changes: 3 additions & 4 deletions src/bans/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,7 @@ pub fn check(
// can cleanup their configs as their dependency graph changes over time
skip_hit.as_mut_bitslice().set(index, true);
} else if !tree_skipper.matches(krate, &mut pack) {
if multi_detector.name == krate.name {
multi_detector.dupes.push(i);
} else {
if multi_detector.name != krate.name {
if multi_detector.dupes.len() > 1 && multiple_versions != LintLevel::Allow {
let severity = match multiple_versions {
LintLevel::Warn => Severity::Warning,
Expand Down Expand Up @@ -419,9 +417,10 @@ pub fn check(

multi_detector.name = &krate.name;
multi_detector.dupes.clear();
multi_detector.dupes.push(i);
}

multi_detector.dupes.push(i);

if wildcards != LintLevel::Allow {
let severity = match wildcards {
LintLevel::Warn => Severity::Warning,
Expand Down
2 changes: 1 addition & 1 deletion src/licenses/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ mod test {
assert!(diags.is_empty());

assert_eq!(validated.file_id, cd.id);
assert_eq!(validated.private.ignore, true);
assert!(validated.private.ignore);
assert_eq!(validated.private.registries, vec!["sekrets".to_owned()]);
assert_eq!(validated.unlicensed, LintLevel::Warn);
assert_eq!(validated.copyleft, LintLevel::Deny);
Expand Down
2 changes: 1 addition & 1 deletion src/licenses/gather.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl LicensePack {
// Add the explicitly specified license if it wasn't
// already found in the root directory
if let Some(ref lf) = krate.license_file {
if lic_paths.iter().find(|l| l.ends_with(lf)).is_none() {
if !lic_paths.iter().any(|l| l.ends_with(lf)) {
// The `krate.license_file` is relative to the crate, while files found with
// `find_license_files()` are absolute. We prepend the directory of the current
// crate, to make sure all license file paths will be absolute.
Expand Down
9 changes: 4 additions & 5 deletions src/manifest/dependency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Dependency {

let (old_path, old_registry) = match self.source {
DependencySource::Version { path, registry, .. } => (path, registry),
_ => (None, None),
DependencySource::Git { .. } => (None, None),
};
self.source = DependencySource::Version {
version: Some(version),
Expand All @@ -93,7 +93,7 @@ impl Dependency {
pub fn set_path(mut self, path: &str) -> Dependency {
let old_version = match self.source {
DependencySource::Version { version, .. } => version,
_ => None,
DependencySource::Git { .. } => None,
};
self.source = DependencySource::Version {
version: old_version,
Expand Down Expand Up @@ -143,7 +143,7 @@ impl Dependency {
pub fn set_registry(mut self, registry: &str) -> Dependency {
let old_version = match self.source {
DependencySource::Version { version, .. } => version,
_ => None,
DependencySource::Git { .. } => None,
};
self.source = DependencySource::Version {
version: old_version,
Expand Down Expand Up @@ -237,8 +237,7 @@ impl Dependency {
data.get_or_insert("optional", optional);
}
if let Some(features) = features {
use std::iter::FromIterator;
let features = toml_edit::Value::from_iter(features.iter().cloned());
let features: toml_edit::Value = features.iter().cloned().collect();
data.get_or_insert("features", features);
}
if !self.default_features {
Expand Down