fix(package): fix warnings
This commit is contained in:
parent
16350123d2
commit
562c44127d
|
@ -100,6 +100,6 @@ pub(crate) mod tests {
|
|||
let tmp_dir = TempDir::new("espanso-package").unwrap();
|
||||
let tmp_path = tmp_dir.path();
|
||||
|
||||
action(&tmp_path);
|
||||
action(tmp_path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,9 +44,7 @@ impl GitPackageProvider {
|
|||
}
|
||||
|
||||
fn clone_repo(dest_dir: &Path, repo_url: &str, repo_branch: Option<&str>) -> Result<()> {
|
||||
let mut args = Vec::new();
|
||||
|
||||
args.push("clone");
|
||||
let mut args = vec!["clone"];
|
||||
|
||||
if let Some(branch) = repo_branch {
|
||||
args.push("-b");
|
||||
|
|
|
@ -78,7 +78,7 @@ pub fn resolve_all_packages(base_dir: &Path) -> Result<Vec<ResolvedPackage>> {
|
|||
for manifest_file in manifest_files {
|
||||
let base_dir = manifest_file
|
||||
.parent()
|
||||
.ok_or(anyhow!("unable to determine base_dir from manifest path"))?
|
||||
.ok_or_else(|| anyhow!("unable to determine base_dir from manifest path"))?
|
||||
.to_owned();
|
||||
let manifest = Manifest::parse(&manifest_file).context("manifest YAML parsing error")?;
|
||||
manifests.push(ResolvedPackage { manifest, base_dir });
|
||||
|
@ -331,7 +331,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_no_manifest_error() {
|
||||
run_with_temp_dir(|base_dir| {
|
||||
assert_eq!(resolve_all_packages(base_dir).is_err(), true);
|
||||
assert!(resolve_all_packages(base_dir).is_err());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -114,6 +114,6 @@ mod tests {
|
|||
name: "espanso".to_string(),
|
||||
});
|
||||
|
||||
assert_eq!(extract_github_url_parts("https://gitlab.com/federicoterzi/espanso-test-package/").is_none(), true);
|
||||
assert!(extract_github_url_parts("https://gitlab.com/federicoterzi/espanso-test-package/").is_none());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,6 @@ mod tests {
|
|||
name: "espanso-test-package".to_string(),
|
||||
});
|
||||
|
||||
assert_eq!(extract_gitlab_url_parts("https://github.com/federicoterzi/espanso-test-package/").is_none(), true);
|
||||
assert!(extract_gitlab_url_parts("https://github.com/federicoterzi/espanso-test-package/").is_none());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user