diff options
Diffstat (limited to 'crates/mozart-core/src/repository')
| -rw-r--r-- | crates/mozart-core/src/repository/downloader.rs | 2 | ||||
| -rw-r--r-- | crates/mozart-core/src/repository/installer_executor.rs (renamed from crates/mozart-core/src/repository/installer_executor/mod.rs) | 3 | ||||
| -rw-r--r-- | crates/mozart-core/src/repository/installer_executor/trace_recorder.rs | 3 | ||||
| -rw-r--r-- | crates/mozart-core/src/repository/path_repository.rs | 13 | ||||
| -rw-r--r-- | crates/mozart-core/src/repository/repository.rs (renamed from crates/mozart-core/src/repository/repository/mod.rs) | 3 |
5 files changed, 10 insertions, 14 deletions
diff --git a/crates/mozart-core/src/repository/downloader.rs b/crates/mozart-core/src/repository/downloader.rs index f2e33a7..711a678 100644 --- a/crates/mozart-core/src/repository/downloader.rs +++ b/crates/mozart-core/src/repository/downloader.rs @@ -350,7 +350,7 @@ pub async fn install_package( #[cfg(test)] mod tests { use super::*; - use std::io::Write as IoWrite; + use std::io::Write as _; use tempfile::tempdir; /// Build a minimal zip archive in memory. diff --git a/crates/mozart-core/src/repository/installer_executor/mod.rs b/crates/mozart-core/src/repository/installer_executor.rs index f67c612..1cb26d2 100644 --- a/crates/mozart-core/src/repository/installer_executor/mod.rs +++ b/crates/mozart-core/src/repository/installer_executor.rs @@ -13,10 +13,9 @@ //! Composer's `(string) $operation` byte-for-byte without the executor //! having to also reproduce console formatting. -use std::path::PathBuf; - use super::installed::InstalledPackageEntry; use super::lockfile::{LockAlias, LockedPackage}; +use std::path::PathBuf; pub mod filesystem; pub mod trace_recorder; diff --git a/crates/mozart-core/src/repository/installer_executor/trace_recorder.rs b/crates/mozart-core/src/repository/installer_executor/trace_recorder.rs index b60a869..5dd39b0 100644 --- a/crates/mozart-core/src/repository/installer_executor/trace_recorder.rs +++ b/crates/mozart-core/src/repository/installer_executor/trace_recorder.rs @@ -14,12 +14,11 @@ //! - Update (downgrade direction): `Downgrading <name> (<oldVersion> => <newVersion>)` //! - Uninstall: `Removing <name> (<version>)` -use mozart_semver::Version; - use super::{ ExecuteContext, InstallerExecutor, PackageOperation, format_full_pretty_alias, format_full_pretty_version, }; +use mozart_semver::Version; /// Recording-only executor. Construct with [`TraceRecorderExecutor::new`], /// then read [`TraceRecorderExecutor::trace`] after the run completes. diff --git a/crates/mozart-core/src/repository/path_repository.rs b/crates/mozart-core/src/repository/path_repository.rs index 0cff012..2353809 100644 --- a/crates/mozart-core/src/repository/path_repository.rs +++ b/crates/mozart-core/src/repository/path_repository.rs @@ -19,11 +19,10 @@ //! consumers comparing references against Composer-produced lockfiles see //! byte-identical values. -use std::path::{Path, PathBuf}; - use crate::package::RawRepository; -use mozart_php_serialize::{Value as PhpValue, serialize as php_serialize}; +use mozart_php_serialize::{Value, serialize}; use sha1::{Digest as _, Sha1}; +use std::path::{Path, PathBuf}; /// Translate path repos in `repositories` into synthetic `type: package` /// entries. Non-path entries are returned unchanged in original order. @@ -123,11 +122,11 @@ fn resolve_path(url: &str, base_dir: &Path) -> PathBuf { /// flag is the only option Composer's auto-detection populates when the user /// supplied no `options` block. fn compute_path_reference(json_bytes: &[u8], is_relative: bool) -> String { - let options = PhpValue::Array(vec![( - PhpValue::String("relative".to_string()), - PhpValue::Bool(is_relative), + let options = Value::Array(vec![( + Value::String("relative".to_string()), + Value::Bool(is_relative), )]); - let serialized = php_serialize(&options); + let serialized = serialize(&options); let mut hasher = Sha1::new(); hasher.update(json_bytes); hasher.update(serialized.as_bytes()); diff --git a/crates/mozart-core/src/repository/repository/mod.rs b/crates/mozart-core/src/repository/repository.rs index 4afff54..ece0c5f 100644 --- a/crates/mozart-core/src/repository/repository/mod.rs +++ b/crates/mozart-core/src/repository/repository.rs @@ -10,10 +10,9 @@ //! the live Packagist HTTP repo, [`inline_package_repo`] for `type: package` //! entries embedded in `composer.json`, and [`vcs_repo`] for VCS repositories. -use std::collections::BTreeMap; - use super::advisory::{MatchedAdvisory, PackageInfo}; use super::packagist::{PackagistVersion, SearchResult}; +use std::collections::BTreeMap; pub mod inline_package_repo; pub mod packagist_repo; |
