Skip to content

expect to Result

expect to Result #235

Triggered via push December 7, 2023 08:52
Status Failure
Total duration 1m 18s
Artifacts

check_format.yml

on: push
cargo fmt
27s
cargo fmt
Clippy lint and check
1m 6s
Clippy lint and check
Fit to window
Zoom out
Zoom in

Annotations

4 errors and 14 warnings
cargo fmt
The process '/home/runner/.cargo/bin/cargo' failed with exit code 1
method `hash_password` has an incompatible type for trait: src/tests/api/helpers.rs#L178
error[E0053]: method `hash_password` has an incompatible type for trait --> src/tests/api/helpers.rs:178:54 | 178 | fn hash_password(&self, password: String) -> String; | ^^^^^^ | | | expected `Result<String, BcryptError>`, found `std::string::String` | help: change the output type to match the trait: `std::result::Result<std::string::String, bcrypt::BcryptError>` | note: type in trait --> src/api/hashing_context.rs:4:50 | 4 | fn hash_password(&self, password: String) -> Result<String,BcryptError>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature `fn(&tests::api::helpers::MockHashingContext, std::string::String) -> std::result::Result<std::string::String, bcrypt::BcryptError>` found signature `fn(&tests::api::helpers::MockHashingContext, std::string::String) -> std::string::String`
method `verify_password` has an incompatible type for trait: src/tests/api/helpers.rs#L179
error[E0053]: method `verify_password` has an incompatible type for trait --> src/tests/api/helpers.rs:179:68 | 179 | fn verify_password(&self, password: String, hash: &str) -> bool; | ^^^^ | | | expected `Result<bool, BcryptError>`, found `bool` | help: change the output type to match the trait: `std::result::Result<bool, bcrypt::BcryptError>` | note: type in trait --> src/api/hashing_context.rs:5:64 | 5 | fn verify_password(&self, password: String, hash: &str) -> Result<bool,BcryptError>; | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature `fn(&tests::api::helpers::MockHashingContext, std::string::String, &str) -> std::result::Result<bool, bcrypt::BcryptError>` found signature `fn(&tests::api::helpers::MockHashingContext, std::string::String, &str) -> bool`
Clippy lint and check
Clippy has exited with exit code 101
cargo fmt: src/api/ecdar_api.rs#L663
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/api/ecdar_api.rs
cargo fmt: src/api/hashing_context.rs#L1
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/api/hashing_context.rs
cargo fmt: src/api/hashing_context.rs#L9
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/api/hashing_context.rs
cargo fmt: src/api/hashing_context.rs#L15
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/api/hashing_context.rs
cargo fmt: src/api/server.rs#L20
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/api/server.rs
cargo fmt: src/database/database_context.rs#L36
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/database/database_context.rs
cargo fmt: src/database/database_context.rs#L66
Diff in /home/runner/work/Ecdar-API/Ecdar-API/src/database/database_context.rs
used `unwrap()` on a `Result` value: src/build.rs#L2
warning: used `unwrap()` on a `Result` value --> src/build.rs:2:5 | 2 | / tonic_build::configure() 3 | | .type_attribute( 4 | | "ComponentsInfo", 5 | | "#[derive(serde::Serialize, serde::Deserialize)]", ... | 13 | | .compile(&["Ecdar-ProtoBuf/services.proto"], &["Ecdar-ProtoBuf/"]) 14 | | .unwrap(); | |_________________^ | = note: if this value is an `Err`, it will panic = help: consider using `expect()` to provide a better panic message = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used = note: requested on the command line with `-W clippy::unwrap-used`
unused import: `DbErr`: src/api/ecdar_api.rs#L22
warning: unused import: `DbErr` --> src/api/ecdar_api.rs:22:15 | 22 | use sea_orm::{DbErr, SqlErr}; | ^^^^^ | = note: `#[warn(unused_imports)]` on by default
unused import: `DbErr`: src/api/ecdar_api.rs#L22
warning: unused import: `DbErr` --> src/api/ecdar_api.rs:22:15 | 22 | use sea_orm::{DbErr, SqlErr}; | ^^^^^ | = note: `#[warn(unused_imports)]` on by default
unnecessary closure used to substitute value for `Option::None`: src/api/auth.rs#L99
warning: unnecessary closure used to substitute value for `Option::None` --> src/api/auth.rs:99:26 | 99 | let expiration = now | __________________________^ 100 | | .checked_add_signed(token_type.duration()) 101 | | .ok_or_else(|| TokenError::InvalidSignature)? | |______________------------------------------------------^ | | | help: use `ok_or(..)` instead: `ok_or(TokenError::InvalidSignature)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
used `unwrap()` on a `Result` value: target/debug/build/api_server-0a97bb8a4683af29/out/ecdar_proto_buf.rs#L1918
warning: used `unwrap()` on a `Result` value --> /home/runner/work/Ecdar-API/Ecdar-API/target/debug/build/api_server-0a97bb8a4683af29/out/ecdar_proto_buf.rs:1918:29 | 1918 | / ... http::Response::builder() 1919 | | ... .status(200) 1920 | | ... .header("grpc-status", "12") 1921 | | ... .header("content-type", "application/grpc") 1922 | | ... .body(empty_body()) 1923 | | ... .unwrap(), | |___________________________________^ | = note: if this value is an `Err`, it will panic = help: consider using `expect()` to provide a better panic message = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used = note: requested on the command line with `-W clippy::unwrap-used`
used `unwrap()` on a `Result` value: target/debug/build/api_server-0a97bb8a4683af29/out/ecdar_proto_buf.rs#L2693
warning: used `unwrap()` on a `Result` value --> /home/runner/work/Ecdar-API/Ecdar-API/target/debug/build/api_server-0a97bb8a4683af29/out/ecdar_proto_buf.rs:2693:29 | 2693 | / ... http::Response::builder() 2694 | | ... .status(200) 2695 | | ... .header("grpc-status", "12") 2696 | | ... .header("content-type", "application/grpc") 2697 | | ... .body(empty_body()) 2698 | | ... .unwrap(), | |___________________________________^ | = note: if this value is an `Err`, it will panic = help: consider using `expect()` to provide a better panic message = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
used `unwrap()` on a `Result` value: target/debug/build/api_server-0a97bb8a4683af29/out/ecdar_proto_buf.rs#L2924
warning: used `unwrap()` on a `Result` value --> /home/runner/work/Ecdar-API/Ecdar-API/target/debug/build/api_server-0a97bb8a4683af29/out/ecdar_proto_buf.rs:2924:29 | 2924 | / ... http::Response::builder() 2925 | | ... .status(200) 2926 | | ... .header("grpc-status", "12") 2927 | | ... .header("content-type", "application/grpc") 2928 | | ... .body(empty_body()) 2929 | | ... .unwrap(), | |___________________________________^ | = note: if this value is an `Err`, it will panic = help: consider using `expect()` to provide a better panic message = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used