Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: simplify Repository and Serde traits, introduce AnyRepository, remove ProtobufSerde #270

Merged
merged 4 commits into from
Dec 11, 2023

refactor(eventually): move to nested, local mod.rs pattern

191273c
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

refactor: simplify Repository and Serde traits, introduce AnyRepository, remove ProtobufSerde #270

refactor(eventually): move to nested, local mod.rs pattern
191273c
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Dec 11, 2023 in 5s

clippy

249 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 249
Note 0
Help 0

Versions

  • rustc 1.76.0-nightly (d86d65bbc 2023-12-10)
  • cargo 1.76.0-nightly (978722961 2023-12-06)
  • clippy 0.1.76 (d86d65b 2023-12-10)

Annotations

Check warning on line 13 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

missing documentation for a function

warning: missing documentation for a function
  --> eventually-macros/src/lib.rs:13:1
   |
13 | pub fn derive_message(input: TokenStream) -> TokenStream {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> eventually-macros/src/lib.rs:4:9
   |
4  | #![warn(missing_docs)]
   |         ^^^^^^^^^^^^

Check warning on line 63 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
  --> eventually-macros/src/lib.rs:63:1
   |
63 | pub fn aggregate_root(args: TokenStream, item: TokenStream) -> TokenStream {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> eventually-macros/src/lib.rs:68:26
   |
68 |       let aggregate_type = args
   |  __________________________^
69 | |         .first()
70 | |         .and_then(|meta| match meta {
71 | |             NestedMeta::Meta(Meta::Path(Path { segments, .. })) => Some(segments),
...  |
75 | |         .map(|segment| segment.ident.clone())
76 | |         .expect("the aggregate root type must be provided as macro parameter");
   | |______________________________________________________________________________^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

Check warning on line 61 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
  --> eventually-macros/src/lib.rs:61:36
   |
61 | /// through [std::ops::Deref] and [std::ops::DerefMut].
   |                                    ^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
   |
61 | /// through [std::ops::Deref] and [`std::ops::DerefMut`].
   |                                    ~~~~~~~~~~~~~~~~~~~~

Check warning on line 61 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
  --> eventually-macros/src/lib.rs:61:14
   |
61 | /// through [std::ops::Deref] and [std::ops::DerefMut].
   |              ^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
   |
61 | /// through [`std::ops::Deref`] and [std::ops::DerefMut].
   |              ~~~~~~~~~~~~~~~~~

Check warning on line 46 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
  --> eventually-macros/src/lib.rs:46:19
   |
46 | /// user-defined [eventually::aggregate::Aggregate] types.
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
   |
46 | /// user-defined [`eventually::aggregate::Aggregate`] types.
   |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 45 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
  --> eventually-macros/src/lib.rs:45:38
   |
45 | /// Implements a newtype to use the [eventually::aggregate::Root] instance with
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
   = note: `#[warn(clippy::doc_markdown)]` implied by `#[warn(clippy::pedantic)]`
help: try
   |
45 | /// Implements a newtype to use the [`eventually::aggregate::Root`] instance with
   |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 24 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

warning: variables can be used directly in the `format!` string
  --> eventually-macros/src/lib.rs:24:26
   |
24 |         let event_name = format!("{}{}", event_prefix, event_type);
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]`
help: change this to
   |
24 -         let event_name = format!("{}{}", event_prefix, event_type);
24 +         let event_name = format!("{event_prefix}{event_type}");
   |

Check warning on line 13 in eventually-macros/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
  --> eventually-macros/src/lib.rs:13:1
   |
13 | pub fn derive_message(input: TokenStream) -> TokenStream {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> eventually-macros/src/lib.rs:16:24
   |
16 |       let event_prefix = item_name
   |  ________________________^
17 | |         .to_string()
18 | |         .strip_suffix("Event")
19 | |         .unwrap()
   | |_________________^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
note: the lint level is defined here
  --> eventually-macros/src/lib.rs:6:9
   |
6  | #![warn(clippy::pedantic)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 236 in /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many lines (112/100)

warning: this function has too many lines (112/100)
   --> /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs:123:9
    |
123 | /         fn call(&mut self, req: http::Request<B>) -> Self::Future {
124 | |             let inner = self.inner.clone();
125 | |             match req.uri().path() {
126 | |                 "/bankaccounting.BankAccounting/OpenBankAccount" => {
...   |
235 | |             }
236 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
    = note: `#[warn(clippy::too_many_lines)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 65 in /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calling `EnabledCompressionEncodings::default()` is more clear than this expression

warning: calling `EnabledCompressionEncodings::default()` is more clear than this expression
  --> /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs:65:45
   |
65 |                 send_compression_encodings: Default::default(),
   |                                             ^^^^^^^^^^^^^^^^^^ help: try: `EnabledCompressionEncodings::default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access

Check warning on line 64 in /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calling `EnabledCompressionEncodings::default()` is more clear than this expression

warning: calling `EnabledCompressionEncodings::default()` is more clear than this expression
  --> /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs:64:47
   |
64 |                 accept_compression_encodings: Default::default(),
   |                                               ^^^^^^^^^^^^^^^^^^ help: try: `EnabledCompressionEncodings::default()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
   = note: `#[warn(clippy::default_trait_access)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 28 in /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of wildcard import

warning: usage of wildcard import
  --> /home/runner/work/eventually-rs/eventually-rs/target/debug/build/bank-accounting-7ceb85f42ea0b821/out/bankaccounting.rs:28:9
   |
28 |     use tonic::codegen::*;
   |         ^^^^^^^^^^^^^^^^^ help: try: `tonic::codegen::{Arc, Body, BoxFuture, CompressionEncoding, Context, EnabledCompressionEncodings, InterceptedService, Poll, StdError, async_trait, empty_body, http}`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
   = note: `#[warn(clippy::wildcard_imports)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 5 in examples/bank-accounting/src/tracing.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
 --> examples/bank-accounting/src/tracing.rs:5:1
  |
5 | pub fn initialize(service_name: &str) -> anyhow::Result<()> {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 5 in examples/bank-accounting/src/postgres.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
 --> examples/bank-accounting/src/postgres.rs:5:1
  |
5 | pub async fn connect() -> anyhow::Result<PgPool> {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 5 in examples/bank-accounting/src/postgres.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
  --> examples/bank-accounting/src/postgres.rs:5:1
   |
5  | pub async fn connect() -> anyhow::Result<PgPool> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> examples/bank-accounting/src/postgres.rs:9:17
   |
9  | /                 std::env::var("DATABASE_HOST")
10 | |                     .expect("env var DATABASE_HOST is required")
   | |________________________________________________________________^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
   = note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 80 in examples/bank-accounting/src/grpc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of wildcard import for enum variants

warning: usage of wildcard import for enum variants
  --> examples/bank-accounting/src/grpc.rs:80:21
   |
80 |                 use BankAccountError::*;
   |                     ^^^^^^^^^^^^^^^^^^^ help: try: `BankAccountError::{Closed, NegativeDepositAttempted, NoMoneyDeposited}`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use

Check warning on line 78 in examples/bank-accounting/src/grpc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
  --> examples/bank-accounting/src/grpc.rs:78:19
   |
78 |             .map(|_| tonic::Response::new(proto::DepositInBankAccountResponse {}))
   |                   ^ help: use `()` instead of `_`: `()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns

Check warning on line 45 in examples/bank-accounting/src/grpc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of wildcard import for enum variants

warning: usage of wildcard import for enum variants
  --> examples/bank-accounting/src/grpc.rs:45:21
   |
45 |                 use BankAccountError::*;
   |                     ^^^^^^^^^^^^^^^^^^^ help: try: `BankAccountError::{AlreadyOpened, EmptyAccountHolderId, EmptyAccountId}`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use
   = note: `#[warn(clippy::enum_glob_use)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 43 in examples/bank-accounting/src/grpc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
  --> examples/bank-accounting/src/grpc.rs:43:19
   |
43 |             .map(|_| tonic::Response::new(proto::OpenBankAccountResponse {}))
   |                   ^ help: use `()` instead of `_`: `()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
   = note: `#[warn(clippy::ignored_unit_patterns)]` implied by `#[warn(clippy::pedantic)]`

Check warning on line 278 in examples/bank-accounting/src/domain.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> examples/bank-accounting/src/domain.rs:278:5
    |
278 |     pub fn reopen(&mut self, reopening_balance: Option<Decimal>) -> Result<(), BankAccountError> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 270 in examples/bank-accounting/src/domain.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> examples/bank-accounting/src/domain.rs:270:5
    |
270 |     pub fn close(&mut self) -> Result<(), BankAccountError> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 261 in examples/bank-accounting/src/domain.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> examples/bank-accounting/src/domain.rs:258:5
    |
258 | /     pub fn record_transfer_success(
259 | |         &mut self,
260 | |         transaction_id: TransactionId,
261 | |     ) -> Result<(), BankAccountError> {
    | |_____________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 238 in examples/bank-accounting/src/domain.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> examples/bank-accounting/src/domain.rs:234:5
    |
234 | /     pub fn receive_transfer(
235 | |         &mut self,
236 | |         transaction: Transaction,
237 | |         message: Option<String>,
238 | |     ) -> Result<(), BankAccountError> {
    | |_____________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 205 in examples/bank-accounting/src/domain.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> examples/bank-accounting/src/domain.rs:201:5
    |
201 | /     pub fn send_transfer(
202 | |         &mut self,
203 | |         mut transaction: Transaction,
204 | |         message: Option<String>,
205 | |     ) -> Result<(), BankAccountError> {
    | |_____________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check warning on line 185 in examples/bank-accounting/src/domain.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

warning: docs for function returning `Result` missing `# Errors` section
   --> examples/bank-accounting/src/domain.rs:185:5
    |
185 |     pub fn deposit(&mut self, money: Decimal) -> Result<(), BankAccountError> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc