From f749a47804cd296a3059cd3f8079c62dbaa5fdc0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 7 Aug 2026 07:26:48 +0900 Subject: 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) --- crates/shirabe/src/dependency_resolver/request.rs | 50 +++++++++++------------ 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'crates/shirabe/src/dependency_resolver/request.rs') 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, - pub(crate) requires: IndexMap, - pub(crate) fixed_packages: IndexMap, - pub(crate) locked_packages: IndexMap, - pub(crate) fixed_locked_packages: IndexMap, - pub(crate) update_allow_list: Vec, - pub(crate) update_allow_transitive_dependencies: UpdateAllowTransitiveDeps, - restrict_packages: Option>, -} -impl Request { pub fn new(locked_repository: Option) -> 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, + pub(crate) requires: IndexMap, + pub(crate) fixed_packages: IndexMap, + pub(crate) locked_packages: IndexMap, + pub(crate) fixed_locked_packages: IndexMap, + pub(crate) update_allow_list: Vec, + pub(crate) update_allow_transitive_dependencies: UpdateAllowTransitiveDeps, + restrict_packages: Option>, +} -- cgit v1.3.1