diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-07 07:26:48 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-07 07:26:48 +0900 |
| commit | f749a47804cd296a3059cd3f8079c62dbaa5fdc0 (patch) | |
| tree | a84d5d40f6f9eea2a83355a273d0fb57214a864a /crates/shirabe/src/dependency_resolver | |
| parent | e7f83b74e8f8c12b4a1b0f9f613387b03858dbdd (diff) | |
| download | php-shirabe-f749a47804cd296a3059cd3f8079c62dbaa5fdc0.tar.gz php-shirabe-f749a47804cd296a3059cd3f8079c62dbaa5fdc0.tar.zst php-shirabe-f749a47804cd296a3059cd3f8079c62dbaa5fdc0.zip | |
refactor: merge split inherent impl blocks into one per type
Enable clippy::multiple_inherent_impl and fix the 21 sites it reports.
Types whose inherent methods were spread across two or three impl blocks
now keep them in a single block; only the impl headers move, no method
bodies change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/request.rs | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/crates/shirabe/src/dependency_resolver/request.rs b/crates/shirabe/src/dependency_resolver/request.rs index 0a05f3e4..d78900c0 100644 --- a/crates/shirabe/src/dependency_resolver/request.rs +++ b/crates/shirabe/src/dependency_resolver/request.rs @@ -25,33 +25,7 @@ impl Request { pub const UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE: i64 = UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE; pub const UPDATE_LISTED_WITH_TRANSITIVE_DEPS: i64 = UPDATE_LISTED_WITH_TRANSITIVE_DEPS; -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum UpdateAllowTransitiveDeps { - /// Corresponds to PHP false. - False, - /// \Composer\DependencyResolver\Request::UPDATE_ONLY_LISTED - UpdateOnlyListed, - /// \Composer\DependencyResolver\Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE - UpdateListedWithTransitiveDepsNoRootRequire, - /// \Composer\DependencyResolver\Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS - UpdateListedWithTransitiveDeps, -} - -#[derive(Debug)] -pub struct Request { - pub(crate) locked_repository: Option<LockArrayRepositoryHandle>, - pub(crate) requires: IndexMap<String, AnyConstraint>, - pub(crate) fixed_packages: IndexMap<String, BasePackageHandle>, - pub(crate) locked_packages: IndexMap<String, BasePackageHandle>, - pub(crate) fixed_locked_packages: IndexMap<String, BasePackageHandle>, - pub(crate) update_allow_list: Vec<String>, - pub(crate) update_allow_transitive_dependencies: UpdateAllowTransitiveDeps, - restrict_packages: Option<Vec<String>>, -} -impl Request { pub fn new(locked_repository: Option<LockArrayRepositoryHandle>) -> Self { Self { locked_repository, @@ -245,3 +219,27 @@ impl Request { self.restrict_packages.as_ref() } } + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum UpdateAllowTransitiveDeps { + /// Corresponds to PHP false. + False, + /// \Composer\DependencyResolver\Request::UPDATE_ONLY_LISTED + UpdateOnlyListed, + /// \Composer\DependencyResolver\Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE + UpdateListedWithTransitiveDepsNoRootRequire, + /// \Composer\DependencyResolver\Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS + UpdateListedWithTransitiveDeps, +} + +#[derive(Debug)] +pub struct Request { + pub(crate) locked_repository: Option<LockArrayRepositoryHandle>, + pub(crate) requires: IndexMap<String, AnyConstraint>, + pub(crate) fixed_packages: IndexMap<String, BasePackageHandle>, + pub(crate) locked_packages: IndexMap<String, BasePackageHandle>, + pub(crate) fixed_locked_packages: IndexMap<String, BasePackageHandle>, + pub(crate) update_allow_list: Vec<String>, + pub(crate) update_allow_transitive_dependencies: UpdateAllowTransitiveDeps, + restrict_packages: Option<Vec<String>>, +} |
