Fix git pull issue and unwrap error #36
rust-fmt.yml
on: pull_request
Run rustfmt style commit
12s
Annotations
4 errors and 2 warnings
`match` arms have incompatible types:
fluere-plugin/src/util.rs#L24
error[E0308]: `match` arms have incompatible types
--> fluere-plugin/src/util.rs:24:13
|
11 | let path_base = match sudo_user {
| --------------- `match` arms have incompatible types
...
14 | / if env::consts::OS == "macos" {
15 | | cache_dir().expect("Could not determine the home directory")
16 | | } else {
17 | | // If SUDO_USER is set, construct the path using the user's home directory
18 | | let user_home = format!("/home/{}", user);
19 | | Path::new(&user_home).join(".cache")
20 | | }
| |_____________- this is found to be of type `std::path::PathBuf`
...
24 | / cache_dir().ok_or(std::io::Error::new(
25 | | std::io::ErrorKind::NotFound,
26 | | "Could not determine the cache directory",
27 | | ))
| |______________^ expected `PathBuf`, found `Result<PathBuf, Error>`
|
= note: expected struct `std::path::PathBuf`
found enum `std::result::Result<std::path::PathBuf, std::io::Error>`
|
the `?` operator can only be applied to values that implement `std::ops::Try`:
fluere-plugin/src/downloader.rs#L19
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> fluere-plugin/src/downloader.rs:19:27
|
19 | .current_dir(&path?)
| ^^^^^ the `?` operator cannot be applied to type `std::path::PathBuf`
|
= help: the trait `std::ops::Try` is not implemented for `std::path::PathBuf`
|
the `?` operator can only be applied to values that implement `std::ops::Try`:
fluere-plugin/src/downloader.rs#L10
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> fluere-plugin/src/downloader.rs:10:21
|
10 | let repo_path = path?.join(repo_name.split('/').last().unwrap());
| ^^^^^ the `?` operator cannot be applied to type `std::path::PathBuf`
|
= help: the trait `std::ops::Try` is not implemented for `std::path::PathBuf`
|
no method named `join` found for enum `std::result::Result` in the current scope:
fluere-plugin/src/lib.rs#L106
error[E0599]: no method named `join` found for enum `std::result::Result` in the current scope
--> fluere-plugin/src/lib.rs:106:62
|
106 | ... let path = home_cache_path().join(name.split('/').last().unwrap());
| ^^^^ method not found in `Result<PathBuf, Error>`
|
note: the method `join` exists on the type `std::path::PathBuf`
--> /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/path.rs:2550:5
help: use the `?` operator to extract the `std::path::PathBuf` value, propagating a `Result::Err` value to the caller
|
106 | let path = home_cache_path()?.join(name.split('/').last().unwrap());
| +
|
this function has too many arguments (27/7):
fluereflow/src/types/fluereflow.rs#L63
warning: this function has too many arguments (27/7)
--> fluereflow/src/types/fluereflow.rs:63:5
|
63 | / pub fn new(
64 | | source: IpAddr,
65 | | destination: IpAddr,
66 | | d_pkts: u32,
... |
90 | | tos: u8,
91 | | ) -> FluereRecord {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
returning the result of a `let` binding from a block:
fluere-config/src/init.rs#L75
warning: returning the result of a `let` binding from a block
--> fluere-config/src/init.rs:75:5
|
74 | let path_config = path_base.join("fluere");
| ------------------------------------------- unnecessary `let` binding
75 | path_config
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
74 ~
75 ~ path_base.join("fluere")
|
|