chore: improve doc #8
clippy
6 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 6 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.78.0-nightly (8f359beca 2024-02-23)
- cargo 1.78.0-nightly (194a60b29 2024-02-21)
- clippy 0.1.78 (8f359be 2024-02-23)
Annotations
Check warning on line 173 in src/main.rs
github-actions / clippy
use of `expect` followed by a function call
warning: use of `expect` followed by a function call
--> src/main.rs:173:10
|
173 | .expect(format!("The god {:?} file must be readable.", &args.god).as_str());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("The god {:?} file must be readable.", &args.god))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
Check warning on line 73 in src/main.rs
github-actions / clippy
binary comparison to literal `Option::None`
warning: binary comparison to literal `Option::None`
--> src/main.rs:73:12
|
73 | if val == None || val.unwrap() == msg.author.id {
| ^^^^^^^^^^^ help: use `Option::is_none()` instead: `val.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
= note: `#[warn(clippy::partialeq_to_none)]` on by default
Check warning on line 25 in src/main.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/main.rs:25:5
|
25 | return std::any::type_name::<T>().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
25 - return std::any::type_name::<T>().to_string();
25 + std::any::type_name::<T>().to_string()
|
Check warning on line 34 in src/ollama.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/ollama.rs:34:9
|
34 | return None;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
34 - return None;
34 + None
|
Check warning on line 25 in src/ollama.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/ollama.rs:25:43
|
25 | pub async fn request(&self, messages: &Vec<ChatMessage>) -> Option<ChatMessage> {
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
help: change this to
|
25 ~ pub async fn request(&self, messages: &[ChatMessage]) -> Option<ChatMessage> {
26 ~ let request = ChatMessageRequest::new(self.model.clone(), messages.to_owned());
|
Check warning on line 124 in src/god.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/god.rs:124:9
|
124 | return prompts;
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
124 - return prompts;
124 + prompts
|