Refactored api tests #78
Annotations
10 warnings
clippy --all-targets --all-features:
src/api/ecdar_api.rs#L408
warning: file is loaded as a module multiple times: `src/api/../tests/api/session_logic.rs`
--> src/api/ecdar_api.rs:408:1
|
408 | / #[cfg(test)]
409 | | #[path = "../tests/api/session_logic.rs"]
410 | | mod session_logic;
| |__________________^ first loaded here
|
::: src/tests/api/mod.rs:2:1
|
2 | mod session_logic;
| ^^^^^^^^^^^^^^^^^^ loaded again here
|
= help: replace all but one `mod` item with `use` items
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_mod
= note: `#[warn(clippy::duplicate_mod)]` on by default
|
clippy --all-targets --all-features:
src/api/ecdar_api.rs#L404
warning: file is loaded as a module multiple times: `src/api/../tests/api/user_logic.rs`
--> src/api/ecdar_api.rs:404:1
|
404 | / #[cfg(test)]
405 | | #[path = "../tests/api/user_logic.rs"]
406 | | mod user_logic;
| |_______________^ first loaded here
|
::: src/tests/api/mod.rs:3:1
|
3 | mod user_logic;
| ^^^^^^^^^^^^^^^ loaded again here
|
= help: replace all but one `mod` item with `use` items
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicate_mod
|
clippy --all-targets --all-features:
src/api/ecdar_api.rs#L28
warning: fields `access_context`, `in_use_context`, `model_context`, and `query_context` are never read
--> src/api/ecdar_api.rs:28:5
|
27 | pub struct ConcreteEcdarApi {
| ---------------- fields in this struct
28 | access_context: Arc<dyn AccessContextTrait>,
| ^^^^^^^^^^^^^^
29 | in_use_context: Arc<dyn InUseContextTrait>,
| ^^^^^^^^^^^^^^
30 | model_context: Arc<dyn ModelContextTrait>,
| ^^^^^^^^^^^^^
31 | query_context: Arc<dyn QueryContextTrait>,
| ^^^^^^^^^^^^^
|
= note: `ConcreteEcdarApi` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
clippy --all-targets --all-features:
src/api/ecdar_api.rs#L28
warning: fields `access_context`, `in_use_context`, `model_context`, and `query_context` are never read
--> src/api/ecdar_api.rs:28:5
|
27 | pub struct ConcreteEcdarApi {
| ---------------- fields in this struct
28 | access_context: Arc<dyn AccessContextTrait>,
| ^^^^^^^^^^^^^^
29 | in_use_context: Arc<dyn InUseContextTrait>,
| ^^^^^^^^^^^^^^
30 | model_context: Arc<dyn ModelContextTrait>,
| ^^^^^^^^^^^^^
31 | query_context: Arc<dyn QueryContextTrait>,
| ^^^^^^^^^^^^^
|
= note: `ConcreteEcdarApi` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
clippy --all-targets --all-features:
src/api/auth.rs#L93
warning: called `unwrap` on `token` after checking its variant with `is_ok`
--> src/api/auth.rs:93:12
|
92 | if token.is_ok() {
| ---------------- help: try: `if let Ok(..) = token`
93 | Ok(token.unwrap().trim_start_matches("Bearer ").to_string())
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
|
clippy --all-targets --all-features:
src/api/auth.rs#L104
warning: unneeded late initialization
--> src/api/auth.rs:104:5
|
104 | let secret: String;
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `secret` here
|
106 | let secret: String = if is_refresh_token {
| ++++++++++++++++++++
help: remove the assignments from the branches
|
107 ~ env::var("REFRESH_TOKEN_HS512_SECRET").expect("Expected HS512_SECRET to be set.")
108 | } else {
109 ~ env::var("ACCESS_TOKEN_HS512_SECRET").expect("Expected HS512_SECRET to be set.")
|
help: add a semicolon after the `if` expression
|
110 | };
| +
|
clippy --all-targets --all-features:
src/api/auth.rs#L93
warning: called `unwrap` on `token` after checking its variant with `is_ok`
--> src/api/auth.rs:93:12
|
92 | if token.is_ok() {
| ---------------- help: try: `if let Ok(..) = token`
93 | Ok(token.unwrap().trim_start_matches("Bearer ").to_string())
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
|
clippy --all-targets --all-features:
src/api/auth.rs#L104
warning: unneeded late initialization
--> src/api/auth.rs:104:5
|
104 | let secret: String;
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `secret` here
|
106 | let secret: String = if is_refresh_token {
| ++++++++++++++++++++
help: remove the assignments from the branches
|
107 ~ env::var("REFRESH_TOKEN_HS512_SECRET").expect("Expected HS512_SECRET to be set.")
108 | } else {
109 ~ env::var("ACCESS_TOKEN_HS512_SECRET").expect("Expected HS512_SECRET to be set.")
|
help: add a semicolon after the `if` expression
|
110 | };
| +
|
clippy --all-targets --all-features:
src/api/server.rs#L18
warning: module has the same name as its containing module
--> src/api/server.rs:18:1
|
18 | / pub mod server {
19 | | tonic::include_proto!("ecdar_proto_buf");
20 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
|
clippy --all-targets --all-features:
src/api/server.rs#L18
warning: module has the same name as its containing module
--> src/api/server.rs:18:1
|
18 | / pub mod server {
19 | | tonic::include_proto!("ecdar_proto_buf");
20 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
|
The logs for this run have expired and are no longer available.
Loading