Skip to content

Tests for Token and request methods #75

Tests for Token and request methods

Tests for Token and request methods #75

Triggered via push November 24, 2023 11:39
Status Failure
Total duration 1m 5s
Artifacts

check_format.yml

on: push
cargo fmt
18s
cargo fmt
Clippy lint and check
54s
Clippy lint and check
Fit to window
Zoom out
Zoom in

Annotations

1 error and 11 warnings
cargo fmt
The process '/home/runner/.cargo/bin/cargo' failed with exit code 1
cargo fmt: src/api/auth.rs#L22
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/api/auth.rs
unused import: `mockall::Any`: src/api/auth.rs#L5
warning: unused import: `mockall::Any` --> src/api/auth.rs:5:5 | 5 | use mockall::Any; | ^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
unused import: `mockall::Any`: src/api/auth.rs#L5
warning: unused import: `mockall::Any` --> src/api/auth.rs:5:5 | 5 | use mockall::Any; | ^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
methods `as_str` and `token_type` are never used: src/api/auth.rs#L177
warning: methods `as_str` and `token_type` are never used --> src/api/auth.rs:177:12 | 83 | impl Token { | ---------- methods in this implementation ... 177 | pub fn as_str(&self) -> &str { | ^^^^^^ ... 191 | pub fn token_type(&self) -> TokenType { | ^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
implementation of inherent method `to_string(&self) -> String` for type `api::auth::Token`: src/api/auth.rs#L163
warning: implementation of inherent method `to_string(&self) -> String` for type `api::auth::Token` --> src/api/auth.rs:163:5 | 163 | / pub fn to_string(&self) -> String { 164 | | self.token.clone() 165 | | } | |_____^ | = help: implement trait `Display` for type `api::auth::Token` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string = note: `#[warn(clippy::inherent_to_string)]` on by default
manual implementation of `Option::map`: src/api/auth.rs#L253
warning: manual implementation of `Option::map` --> src/api/auth.rs:253:9 | 253 | / match self.metadata().get("authorization") { 254 | | Some(token) => Some( 255 | | token 256 | | .to_str() ... | 261 | | None => None, 262 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map = note: `#[warn(clippy::manual_map)]` on by default help: try | 253 ~ self.metadata().get("authorization").map(|token| token 254 + .to_str() 255 + .unwrap() 256 + .trim_start_matches("Bearer ") 257 + .to_string()) |
implementation of inherent method `to_string(&self) -> String` for type `api::auth::Token`: src/api/auth.rs#L163
warning: implementation of inherent method `to_string(&self) -> String` for type `api::auth::Token` --> src/api/auth.rs:163:5 | 163 | / pub fn to_string(&self) -> String { 164 | | self.token.clone() 165 | | } | |_____^ | = help: implement trait `Display` for type `api::auth::Token` instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string = note: `#[warn(clippy::inherent_to_string)]` on by default
manual implementation of `Option::map`: src/api/auth.rs#L253
warning: manual implementation of `Option::map` --> src/api/auth.rs:253:9 | 253 | / match self.metadata().get("authorization") { 254 | | Some(token) => Some( 255 | | token 256 | | .to_str() ... | 261 | | None => None, 262 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map = note: `#[warn(clippy::manual_map)]` on by default help: try | 253 ~ self.metadata().get("authorization").map(|token| token 254 + .to_str() 255 + .unwrap() 256 + .trim_start_matches("Bearer ") 257 + .to_string()) |
unused import: `std::fmt::Display`: src/api/ecdar_api.rs#L1
warning: unused import: `std::fmt::Display` --> src/api/ecdar_api.rs:1:5 | 1 | use std::fmt::Display; | ^^^^^^^^^^^^^^^^^
unused import: `auth`: src/api/ecdar_api.rs#L22
warning: unused import: `auth` --> src/api/ecdar_api.rs:22:5 | 22 | auth, | ^^^^
unused import: `std::fmt::Display`: src/api/ecdar_api.rs#L1
warning: unused import: `std::fmt::Display` --> src/api/ecdar_api.rs:1:5 | 1 | use std::fmt::Display; | ^^^^^^^^^^^^^^^^^