diff --git a/rocks-bin/src/search.rs b/rocks-bin/src/search.rs index 86d999c7..596922e0 100644 --- a/rocks-bin/src/search.rs +++ b/rocks-bin/src/search.rs @@ -25,7 +25,7 @@ pub async fn search(data: Search, config: &Config) -> Result<()> { // TODO(vhyrro): Pull in global configuration in the form of a second parameter (including which server to use for the manifest). - let manifest = manifest_from_server(config.server.to_owned(), &config).await?; + let manifest = manifest_from_server(config.server.to_owned(), config).await?; let metadata = ManifestMetadata::new(&manifest)?; diff --git a/rocks-lib/src/config/mod.rs b/rocks-lib/src/config/mod.rs index b9f02f3a..e4105f95 100644 --- a/rocks-lib/src/config/mod.rs +++ b/rocks-lib/src/config/mod.rs @@ -63,7 +63,7 @@ impl Config { pub fn only_server(self, server: Option) -> Config { Config { only_server: server.clone(), - server: server.unwrap_or_else(|| self.server), + server: server.unwrap_or(self.server), ..self } } diff --git a/rocks-lib/src/manifest/metadata.rs b/rocks-lib/src/manifest/metadata.rs index 460c6e9c..0fbe16e0 100644 --- a/rocks-lib/src/manifest/metadata.rs +++ b/rocks-lib/src/manifest/metadata.rs @@ -26,8 +26,7 @@ impl ManifestMetadata { } pub async fn from_config(config: &Config) -> Result { - let manifest = - crate::manifest::manifest_from_server(config.server.clone(), &config).await?; + let manifest = crate::manifest::manifest_from_server(config.server.clone(), config).await?; Self::new(&manifest) } diff --git a/rocks-lib/src/rocks/download.rs b/rocks-lib/src/rocks/download.rs index 37fd2563..0c8e92b9 100644 --- a/rocks-lib/src/rocks/download.rs +++ b/rocks-lib/src/rocks/download.rs @@ -12,7 +12,7 @@ pub async fn download( ) -> Result<(String, String)> { // TODO(vhyrro): Check if the rock has a `src` attribute, add better error checking. Make sure to use the latest version of a rock if the version is ommitted. - let manifest = crate::manifest::ManifestMetadata::from_config(&config).await?; + let manifest = crate::manifest::ManifestMetadata::from_config(config).await?; if !manifest.has_rock(rock_name) { return Err(eyre!(format!(