diff --git a/crates/aiken-project/src/deps.rs b/crates/aiken-project/src/deps.rs index 049228b55..8655d37b5 100644 --- a/crates/aiken-project/src/deps.rs +++ b/crates/aiken-project/src/deps.rs @@ -133,12 +133,7 @@ impl From<&Manifest> for LocalPackages { } } -pub fn download( - event_listener: &T, - use_manifest: UseManifest, - root_path: &Path, - config: &Config, -) -> Result +pub fn download(event_listener: &T, root_path: &Path, config: &Config) -> Result where T: EventListener, { @@ -164,13 +159,7 @@ where let runtime = tokio::runtime::Runtime::new().expect("Unable to start Tokio"); - let (manifest, changed) = Manifest::load( - runtime.handle().clone(), - event_listener, - config, - use_manifest, - root_path, - )?; + let (manifest, changed) = Manifest::load(event_listener, config, root_path)?; let local = LocalPackages::load(root_path)?; diff --git a/crates/aiken-project/src/deps/manifest.rs b/crates/aiken-project/src/deps/manifest.rs index a78da24f4..6ec99fbc7 100644 --- a/crates/aiken-project/src/deps/manifest.rs +++ b/crates/aiken-project/src/deps/manifest.rs @@ -12,8 +12,6 @@ use crate::{ telemetry::{Event, EventListener}, }; -use super::UseManifest; - #[derive(Deserialize, Serialize, Debug)] pub struct Manifest { pub requirements: Vec, @@ -22,10 +20,8 @@ pub struct Manifest { impl Manifest { pub fn load( - runtime: tokio::runtime::Handle, event_listener: &T, config: &Config, - use_manifest: UseManifest, root_path: &Path, ) -> Result<(Self, bool), Error> where @@ -35,15 +31,10 @@ impl Manifest { // If there's no manifest (or we have been asked not to use it) then resolve // the versions anew - let should_resolve = match use_manifest { - _ if !manifest_path.exists() => true, - UseManifest::No => true, - UseManifest::Yes => false, - }; + let should_resolve = !manifest_path.exists(); if should_resolve { - let manifest = resolve_versions(runtime, config, None, event_listener)?; - + let manifest = resolve_versions(config, event_listener)?; return Ok((manifest, true)); } @@ -61,13 +52,12 @@ impl Manifest { help: e.to_string(), })?; - // If the config has unchanged since the manifest was written then it is up + // If the config is unchanged since the manifest was written then it is up // to date so we can return it unmodified. if manifest.requirements == config.dependencies { Ok((manifest, false)) } else { - let manifest = resolve_versions(runtime, config, Some(&manifest), event_listener)?; - + let manifest = resolve_versions(config, event_listener)?; Ok((manifest, true)) } } @@ -96,12 +86,7 @@ pub struct Package { pub source: Platform, } -fn resolve_versions( - _runtime: tokio::runtime::Handle, - config: &Config, - _manifest: Option<&Manifest>, - event_listener: &T, -) -> Result +fn resolve_versions(config: &Config, event_listener: &T) -> Result where T: EventListener, { diff --git a/crates/aiken-project/src/lib.rs b/crates/aiken-project/src/lib.rs index f875c976f..4afc149a1 100644 --- a/crates/aiken-project/src/lib.rs +++ b/crates/aiken-project/src/lib.rs @@ -27,7 +27,6 @@ use aiken_lang::{ tipo::TypeInfo, IdGenerator, }; -use deps::UseManifest; use indexmap::IndexMap; use miette::NamedSource; use options::{CodeGenMode, Options}; @@ -491,12 +490,7 @@ where } fn compile_deps(&mut self) -> Result<(), Vec> { - let manifest = deps::download( - &self.event_listener, - UseManifest::Yes, - &self.root, - &self.config, - )?; + let manifest = deps::download(&self.event_listener, &self.root, &self.config)?; for package in manifest.packages { let lib = self.root.join(paths::build_deps_package(&package.name));