439 lines
27 KiB
Text
439 lines
27 KiB
Text
cargo : Compiling botapp v6.1.0
|
|
(C:\Users\thipa\generalbots\gb\botapp)
|
|
No linha:1 caractere:71
|
|
+ ... :CARGO_TERM_COLOR="never"; cargo clippy
|
|
--workspace > clippy.txt 2>&1
|
|
+
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
+ CategoryInfo : NotSpecified: ( Compili
|
|
ng bo...bots\gb\botapp):String) [], RemoteException
|
|
+ FullyQualifiedErrorId : NativeCommandError
|
|
|
|
warning: unused import: `debug`
|
|
-->
|
|
botserver\src\core\bootstrap\bootstrap_utils.rs:2:11
|
|
|
|
|
2 | use log::{debug, info, warn};
|
|
| ^^^^^
|
|
|
|
|
= note: `#[warn(unused_imports)]` (part of
|
|
`#[warn(unused)]`) on by default
|
|
|
|
warning: unused import: `std::process::Command`
|
|
-->
|
|
botserver\src\core\bootstrap\bootstrap_manager.rs:8:5
|
|
|
|
|
8 | use std::process::Command;
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
warning: unnecessary `>= y + 1` or `x - 1 >=`
|
|
-->
|
|
botserver\src\core\bot\channels\whatsapp.rs:506:52
|
|
|
|
|
506 | ...&& current_part.len() + list_block.len() + 1
|
|
<= max_length {
|
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: change it to: `current_part.len() +
|
|
list_block.len() < max_length`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#int_plu
|
|
s_one
|
|
= note: `#[warn(clippy::int_plus_one)]` on by
|
|
default
|
|
|
|
warning: used consecutive `str::replace` call
|
|
--> botserver\src\auto_task\orchestrator.rs:662:44
|
|
|
|
|
662 | ...().replace(' ', "_").replace('-', "_");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help:
|
|
replace with: `replace([' ', '-'], "_")`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#collaps
|
|
ible_str_replace
|
|
= note: `#[warn(clippy::collapsible_str_replace)]`
|
|
on by default
|
|
|
|
warning: used consecutive `str::replace` call
|
|
--> botserver\src\auto_task\orchestrator.rs:684:44
|
|
|
|
|
684 | ...().replace(' ', "_").replace('-', "_");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help:
|
|
replace with: `replace([' ', '-'], "_")`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#collaps
|
|
ible_str_replace
|
|
|
|
warning: the borrowed expression implements the
|
|
required traits
|
|
--> botserver\src\auto_task\orchestrator.rs:900:13
|
|
|
|
|
900 | ... &format!("Mantis #{agent_id} activity"),
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: change this to: `format!("Mantis #{agent_id}
|
|
activity")`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_borrows_for_generic_args
|
|
= note:
|
|
`#[warn(clippy::needless_borrows_for_generic_args)]` on
|
|
by default
|
|
|
|
warning: the borrowed expression implements the
|
|
required traits
|
|
--> botserver\src\auto_task\container_session.rs:28:19
|
|
|
|
|
28 | ...gs(&["launch", "ubuntu:22.04", &container_name])
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: change this to: `["launch", "ubuntu:22.04",
|
|
&container_name]`
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#needless
|
|
_borrows_for_generic_args
|
|
|
|
warning: the borrowed expression implements the
|
|
required traits
|
|
--> botserver\src\auto_task\container_session.rs:53:19
|
|
|
|
|
53 | ...gs(&["exec", &self.container_name, "--",
|
|
"bash"])
|
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help:
|
|
change this to: `["exec", &self.container_name, "--",
|
|
"bash"]`
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#needless
|
|
_borrows_for_generic_args
|
|
|
|
warning: the borrowed expression implements the
|
|
required traits
|
|
-->
|
|
botserver\src\auto_task\container_session.rs:118:19
|
|
|
|
|
118 | ...gs(&["delete", &self.container_name,
|
|
"--force"])
|
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help:
|
|
change this to: `["delete", &self.container_name,
|
|
"--force"]`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_borrows_for_generic_args
|
|
|
|
warning: this expression creates a reference which is
|
|
immediately dereferenced by the compiler
|
|
--> botserver\src\basic\keywords\send_mail.rs:353:17
|
|
|
|
|
353 | &to,
|
|
| ^^^ help: change this to: `to`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_borrow
|
|
= note: `#[warn(clippy::needless_borrow)]` on by
|
|
default
|
|
|
|
warning: this expression creates a reference which is
|
|
immediately dereferenced by the compiler
|
|
--> botserver\src\basic\keywords\send_mail.rs:354:17
|
|
|
|
|
354 | &subject,
|
|
| ^^^^^^^^ help: change this to:
|
|
`subject`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_borrow
|
|
|
|
warning: this expression creates a reference which is
|
|
immediately dereferenced by the compiler
|
|
--> botserver\src\basic\keywords\send_mail.rs:355:17
|
|
|
|
|
355 | &body,
|
|
| ^^^^^ help: change this to: `body`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_borrow
|
|
|
|
warning: this `impl` can be derived
|
|
--> botserver\src\basic\keywords\sms.rs:57:1
|
|
|
|
|
57 | / impl Default for SmsPriority {
|
|
58 | | fn default() -> Self {
|
|
59 | | Self::Normal
|
|
60 | | }
|
|
61 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#derivabl
|
|
e_impls
|
|
= note: `#[warn(clippy::derivable_impls)]` on by
|
|
default
|
|
help: replace the manual implementation with a derive
|
|
attribute and mark the default variant
|
|
|
|
|
50 + #[derive(Default)]
|
|
51 | pub enum SmsPriority {
|
|
52 | Low,
|
|
53 ~ #[default]
|
|
54 ~ Normal,
|
|
|
|
|
|
|
warning: unnecessary closure used to substitute value
|
|
for `Option::None`
|
|
-->
|
|
botserver\src\core\bootstrap\bootstrap_manager.rs:34:9
|
|
|
|
|
34 | / ... self.stack_dir(&format!("bin/vault/{}",
|
|
b...
|
|
35 | | ... .to_str()
|
|
36 | | ... .unwrap_or_else(|| {
|
|
37 | | ... if cfg!(target_os = "windows") {
|
|
... |
|
|
42 | | ... })
|
|
| |____________^
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#unnecess
|
|
ary_lazy_evaluations
|
|
= note:
|
|
`#[warn(clippy::unnecessary_lazy_evaluations)]` on by
|
|
default
|
|
help: use `unwrap_or` instead
|
|
|
|
|
36 ~ .unwrap_or({
|
|
37 + if cfg!(target_os = "windows") {
|
|
38 +
|
|
"./botserver-stack/bin/vault/vault.exe"
|
|
39 + } else {
|
|
40 +
|
|
"./botserver-stack/bin/vault/vault"
|
|
41 + }
|
|
42 + })
|
|
|
|
|
|
|
warning: manual implementation of `.is_multiple_of()`
|
|
-->
|
|
botserver\src\core\bootstrap\bootstrap_manager.rs:191:28
|
|
|
|
|
191 | ... if total_waited % 10 == 0 || i == 0 {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace
|
|
with: `total_waited.is_multiple_of(10)`
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#manual_
|
|
is_multiple_of
|
|
= note: `#[warn(clippy::manual_is_multiple_of)]` on
|
|
by default
|
|
|
|
warning: this `impl` can be derived
|
|
--> botserver\src\core\bot\channels\whatsapp_rate_limi
|
|
ter.rs:42:1
|
|
|
|
|
42 | / impl Default for WhatsAppTier {
|
|
43 | | fn default() -> Self {
|
|
44 | | Self::Tier1
|
|
45 | | }
|
|
46 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#derivabl
|
|
e_impls
|
|
help: replace the manual implementation with a derive
|
|
attribute and mark the default variant
|
|
|
|
|
31 + #[derive(Default)]
|
|
32 | pub enum WhatsAppTier {
|
|
33 | /// Tier 1: New phone numbers (40 msg/s, 1000
|
|
conv/day)
|
|
34 ~ #[default]
|
|
35 ~ Tier1,
|
|
|
|
|
|
|
warning: unneeded `return` statement
|
|
-->
|
|
botserver\src\core\package_manager\installer.rs:237:13
|
|
|
|
|
237 | ... return get_component_url("llm_win_cpu_x64");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_return
|
|
= note: `#[warn(clippy::needless_return)]` on by
|
|
default
|
|
help: remove `return`
|
|
|
|
|
237 - return
|
|
get_component_url("llm_win_cpu_x64");
|
|
237 + get_component_url("llm_win_cpu_x64")
|
|
|
|
|
|
|
warning: called `unwrap` on
|
|
`component.check_cmd_windows` after checking its
|
|
variant with `is_some`
|
|
-->
|
|
botserver\src\core\package_manager\installer.rs:1279:17
|
|
|
|
|
1278 | ...et check_cmd = if cfg!(target_os = "windows")
|
|
&& component.check_cmd_windows.is_some() {
|
|
|
|
|
------------------------------------- the check is
|
|
happening here
|
|
1279 | ...
|
|
component.check_cmd_windows.as_ref().unwrap().clone()
|
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `match`
|
|
= help: for further information visit https://rust-
|
|
lang.github.io/rust-clippy/rust-1.93.0/index.html#unnece
|
|
ssary_unwrap
|
|
= note: `#[warn(clippy::unnecessary_unwrap)]` on
|
|
by default
|
|
|
|
warning: called `unwrap` on
|
|
`component.exec_cmd_windows` after checking its variant
|
|
with `is_some`
|
|
-->
|
|
botserver\src\core\package_manager\installer.rs:1302:17
|
|
|
|
|
1301 | ...et mut rendered_cmd = if cfg!(target_os =
|
|
"windows") && component.exec_cmd_windows.is_some() {
|
|
|
|
|
------------------------------------ the
|
|
check is happening here
|
|
1302 | ...
|
|
component.exec_cmd_windows.as_ref().unwrap().clone()
|
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: try using `match`
|
|
= help: for further information visit https://rust-
|
|
lang.github.io/rust-clippy/rust-1.93.0/index.html#unnece
|
|
ssary_unwrap
|
|
|
|
warning: this `impl` can be derived
|
|
--> botserver\src\deployment\types.rs:84:1
|
|
|
|
|
84 | / impl Default for DeploymentEnvironment {
|
|
85 | | fn default() -> Self {
|
|
86 | | DeploymentEnvironment::Development
|
|
87 | | }
|
|
88 | | }
|
|
| |_^
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#derivabl
|
|
e_impls
|
|
help: replace the manual implementation with a derive
|
|
attribute and mark the default variant
|
|
|
|
|
78 + #[derive(Default)]
|
|
79 | pub enum DeploymentEnvironment {
|
|
80 ~ #[default]
|
|
81 ~ Development,
|
|
|
|
|
|
|
warning: stripping a prefix manually
|
|
--> botserver\src\security\command_guard.rs:545:39
|
|
|
|
|
545 | ... PathBuf::from(&path_str[4..]);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: the prefix was tested here
|
|
--> botserver\src\security\command_guard.rs:544:9
|
|
|
|
|
544 | if path_str.starts_with(r"\\?\") {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#manual_
|
|
strip
|
|
= note: `#[warn(clippy::manual_strip)]` on by
|
|
default
|
|
help: try using the `strip_prefix` method
|
|
|
|
|
544 ~ if let Some(<stripped>) =
|
|
path_str.strip_prefix(r"\\?\") {
|
|
545 ~ canonical = PathBuf::from(<stripped>);
|
|
|
|
|
|
|
warning: this function has too many arguments (9/7)
|
|
--> botserver\src\email\messages.rs:86:1
|
|
|
|
|
86 | / fn save_email_tracking_record(
|
|
87 | | conn:
|
|
diesel::r2d2::Pool<diesel::r2d2::Conn...
|
|
88 | | tracking_id: Uuid,
|
|
89 | | account_id: Uuid,
|
|
... |
|
|
95 | | subject: &str,
|
|
96 | | ) -> Result<(), String> {
|
|
| |_______________________^
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#too_many
|
|
_arguments
|
|
= note: `#[warn(clippy::too_many_arguments)]` on by
|
|
default
|
|
|
|
warning: this function has too many arguments (9/7)
|
|
--> botserver\src\email\tracking.rs:52:1
|
|
|
|
|
52 | / pub fn save_email_tracking_record(
|
|
53 | | conn: crate::core::shared::utils::DbPool,
|
|
54 | | tracking_id: Uuid,
|
|
55 | | account_id: Uuid,
|
|
... |
|
|
61 | | subject: &str,
|
|
62 | | ) -> Result<(), String> {
|
|
| |_______________________^
|
|
|
|
|
= help: for further information visit https://rust-la
|
|
ng.github.io/rust-clippy/rust-1.93.0/index.html#too_many
|
|
_arguments
|
|
|
|
warning: unneeded `return` statement
|
|
--> botserver\src\llm\local.rs:217:5
|
|
|
|
|
217 | return Ok(());
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: for further information visit https://rust-l
|
|
ang.github.io/rust-clippy/rust-1.93.0/index.html#needles
|
|
s_return
|
|
help: remove `return`
|
|
|
|
|
217 - return Ok(());
|
|
217 + Ok(())
|
|
|
|
|
|
|
warning: `botserver` (bin "botserver") generated 24
|
|
warnings (run `cargo clippy --fix --bin "botserver" -p
|
|
botserver` to apply 19 suggestions)
|
|
warning: unused import:
|
|
`super::safe_command::SafeCommand`
|
|
--> botapp\src\desktop\tray.rs:1:5
|
|
|
|
|
1 | use super::safe_command::SafeCommand;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[warn(unused_imports)]` (part of
|
|
`#[warn(unused)]`) on by default
|
|
|
|
warning: `botapp` (lib) generated 1 warning (run `cargo
|
|
clippy --fix --lib -p botapp` to apply 1 suggestion)
|
|
warning: `botapp` (bin "botapp") generated 1 warning (1
|
|
duplicate)
|
|
Finished `dev` profile [unoptimized + debuginfo]
|
|
target(s) in 3.19s
|