Skip to content

Commit

Permalink
Merge pull request #28 from syrtcevvi/feature/increase-di-params-to-15
Browse files Browse the repository at this point in the history
Support up to 12 params in the handlers
  • Loading branch information
hirrolot authored Jun 25, 2024
2 parents da3de9d + ad29be1 commit 52e11f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## unreleased

### Added

- The handlers now can accept up to 12 parameters instead of 9.

## 0.3.0 - 2022-07-19

### Added
Expand Down
23 changes: 13 additions & 10 deletions src/di.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ where
///
/// 1. For each function parameter of type `T`, `Input` must satisfy
/// `DependencySupplier<T>`.
/// 2. The function must be of 0-9 arguments.
/// 2. The function must be of 0-12 arguments.
/// 3. The function must return [`Future`].
pub trait Injectable<Input, Output, FnArgs> {
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>;
Expand Down Expand Up @@ -245,15 +245,18 @@ macro_rules! impl_into_di {
}

impl_into_di!();
impl_into_di!(A);
impl_into_di!(A, B);
impl_into_di!(A, B, C);
impl_into_di!(A, B, C, D);
impl_into_di!(A, B, C, D, E);
impl_into_di!(A, B, C, D, E, F);
impl_into_di!(A, B, C, D, E, F, G);
impl_into_di!(A, B, C, D, E, F, G, H);
impl_into_di!(A, B, C, D, E, F, G, H, I);
impl_into_di!(T1);
impl_into_di!(T1, T2);
impl_into_di!(T1, T2, T3);
impl_into_di!(T1, T2, T3, T4);
impl_into_di!(T1, T2, T3, T4, T5);
impl_into_di!(T1, T2, T3, T4, T5, T6);
impl_into_di!(T1, T2, T3, T4, T5, T6, T7);
impl_into_di!(T1, T2, T3, T4, T5, T6, T7, T8);
impl_into_di!(T1, T2, T3, T4, T5, T6, T7, T8, T9);
impl_into_di!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10);
impl_into_di!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11);
impl_into_di!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12);

/// Constructs [`DependencyMap`] with a list of dependencies.
///
Expand Down

0 comments on commit 52e11f5

Please sign in to comment.