Skip to content

refactor: migrate web server to Actix Web #412

refactor: migrate web server to Actix Web

refactor: migrate web server to Actix Web #412

GitHub Actions / clippy failed Sep 19, 2024 in 1s

clippy

6 errors

Details

Results

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

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check failure on line 70 in src/server/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied

error[E0599]: the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied
  --> src/server/error.rs:70:26
   |
11 | pub(crate) enum ServerError {
   | --------------------------- doesn't satisfy `server::error::ServerError: derive_more::Display` or `server::error::ServerError: std::string::ToString`
...
70 |                     self.to_string(),
   |                          ^^^^^^^^^ method cannot be called on `&ServerError` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `server::error::ServerError: derive_more::Display`
           which is required by `server::error::ServerError: std::string::ToString`
           `&server::error::ServerError: derive_more::Display`
           which is required by `&server::error::ServerError: std::string::ToString`
note: the trait `derive_more::Display` must be implemented
  --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/fmt/mod.rs:728:1
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `to_string`, perhaps you need to implement it:
           candidate #1: `std::string::ToString`

Check failure on line 62 in src/server/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied

error[E0599]: the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied
  --> src/server/error.rs:62:26
   |
11 | pub(crate) enum ServerError {
   | --------------------------- doesn't satisfy `server::error::ServerError: derive_more::Display` or `server::error::ServerError: std::string::ToString`
...
62 |                     self.to_string(),
   |                          ^^^^^^^^^ method cannot be called on `&ServerError` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `server::error::ServerError: derive_more::Display`
           which is required by `server::error::ServerError: std::string::ToString`
           `&server::error::ServerError: derive_more::Display`
           which is required by `&server::error::ServerError: std::string::ToString`
note: the trait `derive_more::Display` must be implemented
  --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/fmt/mod.rs:728:1
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `to_string`, perhaps you need to implement it:
           candidate #1: `std::string::ToString`

Check failure on line 54 in src/server/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied

error[E0599]: the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied
  --> src/server/error.rs:54:26
   |
11 | pub(crate) enum ServerError {
   | --------------------------- doesn't satisfy `server::error::ServerError: derive_more::Display` or `server::error::ServerError: std::string::ToString`
...
54 |                     self.to_string(),
   |                          ^^^^^^^^^ method cannot be called on `&ServerError` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `server::error::ServerError: derive_more::Display`
           which is required by `server::error::ServerError: std::string::ToString`
           `&server::error::ServerError: derive_more::Display`
           which is required by `&server::error::ServerError: std::string::ToString`
note: the trait `derive_more::Display` must be implemented
  --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/fmt/mod.rs:728:1
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `to_string`, perhaps you need to implement it:
           candidate #1: `std::string::ToString`

Check failure on line 48 in src/server/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied

error[E0599]: the method `to_string` exists for reference `&ServerError`, but its trait bounds were not satisfied
  --> src/server/error.rs:48:69
   |
11 | pub(crate) enum ServerError {
   | --------------------------- doesn't satisfy `server::error::ServerError: derive_more::Display` or `server::error::ServerError: std::string::ToString`
...
48 |             ServerError::PopularItemsFailed => res.body(render(self.to_string(), "").0),
   |                                                                     ^^^^^^^^^ method cannot be called on `&ServerError` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `server::error::ServerError: derive_more::Display`
           which is required by `server::error::ServerError: std::string::ToString`
           `&server::error::ServerError: derive_more::Display`
           which is required by `&server::error::ServerError: std::string::ToString`
note: the trait `derive_more::Display` must be implemented
  --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/fmt/mod.rs:728:1
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `to_string`, perhaps you need to implement it:
           candidate #1: `std::string::ToString`

Check failure on line 44 in src/server/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`server::error::ServerError` doesn't implement `derive_more::Display`

error[E0277]: `server::error::ServerError` doesn't implement `derive_more::Display`
  --> src/server/error.rs:44:48
   |
44 |         let mut res = HttpResponse::build(self.status_code());
   |                                                ^^^^^^^^^^^ `server::error::ServerError` cannot be formatted with the default formatter
   |
   = help: the trait `derive_more::Display` is not implemented for `server::error::ServerError`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `actix_web::ResponseError::status_code`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.9.0/src/error/response_error.rs:26:39
   |
26 | pub trait ResponseError: fmt::Debug + fmt::Display {
   |                                       ^^^^^^^^^^^^ required by this bound in `ResponseError::status_code`
...
31 |     fn status_code(&self) -> StatusCode {
   |        ----------- required by a bound in this associated function

Check failure on line 31 in src/server/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`server::error::ServerError` doesn't implement `derive_more::Display`

error[E0277]: `server::error::ServerError` doesn't implement `derive_more::Display`
  --> src/server/error.rs:31:24
   |
31 | impl ResponseError for ServerError {
   |                        ^^^^^^^^^^^ `server::error::ServerError` cannot be formatted with the default formatter
   |
   = help: the trait `derive_more::Display` is not implemented for `server::error::ServerError`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `actix_web::ResponseError`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.9.0/src/error/response_error.rs:26:39
   |
26 | pub trait ResponseError: fmt::Debug + fmt::Display {
   |                                       ^^^^^^^^^^^^ required by this bound in `ResponseError`